Skip to content

Instantly share code, notes, and snippets.

@hfcc8685
hfcc8685 / static_server.js
Created July 6, 2016 03:16 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@hfcc8685
hfcc8685 / category_list.rb
Created April 20, 2012 17:33 — forked from nistude/category_list.rb
A category list tag for jekyll
# place this file in your plugins directory and add the tag to your sidebar
#$ cat source/_includes/custom/asides/categories.html
#<section>
# <h1>Categories</h1>
# <ul id="categories">
# {% category_list %}
# </ul>
#</section>
module Jekyll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Input;
using PagePlanner.Windows.Controls.TriggerActions;
namespace PagePlanner.Windows.Controls.Behaviours.KeyGestures
{
@hfcc8685
hfcc8685 / gist:2061420
Created March 17, 2012 15:54 — forked from padolsey/gist:527683
JavaScript:detecting IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}