Skip to content

Instantly share code, notes, and snippets.

@Longfld
Longfld / Serilog
Last active April 24, 2020 19:07
How to use serilog in ASP.NET Core 2.0
How to use serilog in ASP.NET Core 2.0
One of major changes core 2.0 compare to core 2 preview is how to registe logging.
logging should be configged before website instanced.
public class Program
{
public static void Main(string[] args)
{
@carsonfarmer
carsonfarmer / README.md
Last active October 23, 2019 22:21
A simple text-based clock using D3js

Text-Based Clock

A simple text-based clock that can be used as a Mac OSX Dashboard Widget

How to make the widget

  1. Clone this gist or click "Download Gist" on the right and extract the archive
  2. Copy the folder and its contents to somewhere 'safe' (i.e., where you won't delete it)
  3. Double click index.html to open the webpage in Safari
  4. Click the 'File' menu, then click 'Open in Dashboard...'
  5. Your screen will dim, and you can select the area you want to display in the widget
@auser
auser / app.js
Last active October 11, 2017 03:01
The complete source for the http://www.ng-newsletter.com/posts/chrome-apps-on-angular.html article. Enjoy!
angular.module('myApp', ['ngRoute'])
.provider('Weather', function() {
var apiKey = "";
this.getUrl = function(type, ext) {
return "http://api.wunderground.com/api/" +
this.apiKey + "/" + type + "/q/" +
ext + '.json';
};
@haf
haf / Topshelf.FSharp.fs
Last active October 11, 2017 13:23
Configure TopShelf in F#
namespace Topshelf
[<AutoOpen>]
module Topshelf =
open System
open Topshelf.HostConfigurators
open Topshelf.Runtime
let configureTopShelf f =
@kzk
kzk / evhttp-multh-thread-httpd.cpp
Created November 6, 2010 13:53
Multi-Threaded HTTPServer using evhttp
#include <event.h>
#include <evhttp.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <iostream>