Skip to content

Instantly share code, notes, and snippets.

View ghuntley's full-sized avatar
minimalist

Geoffrey Huntley ghuntley

minimalist
View GitHub Profile
@txdv
txdv / Epoch.cs
Created July 20, 2011 16:04
Epoch class for handling unix times
using System;
namespace Epoch
{
public class Epoch
{
static readonly DateTime epochStart = new DateTime(1970, 1, 1, 0, 0, 0);
static readonly DateTimeOffset epochDateTimeOffset = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
@jelder
jelder / ChromeFullscreen.applescript
Created December 9, 2011 22:24
AppleScript to launch Chrome in Presentation mode (Fullscreen)
# url.txt should contain the URL load in Chrome in full screen.
do shell script "open '/Applications/Google Chrome.app' " & readFile("/url.txt")
tell application "Google Chrome" to activate
tell application "System Events"
keystroke "f" using {command down, shift down}
end tell
# All this just to read a file; no backticks in AppleScript.
on readFile(unixPath)
@waynegraham
waynegraham / generateTable.xsl
Created March 20, 2012 14:43
Converts Infopath XML to HTML table
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2011-11-08T19:40:02"
exclude-result-prefixes="my"
version="1.0">
<xsl:output method="html" />
<xsl:strip-space elements="*" />
<xsl:param name="delimter" select="'|'" />
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@calvinmetcalf
calvinmetcalf / README.md
Created July 20, 2012 11:50
Using ESRI JSON in Leaflet

Basic example of taking an output from our server and putting it on a map. As leaflet allows you to add geoJSON directly, we convert it from esri's JSON format to a more standard one.

@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@dbeattie71
dbeattie71 / Epoch.cs
Created November 6, 2012 20:01 — forked from txdv/Epoch.cs
Epoch class for handling unix times
using System;
namespace Epoch
{
public class Epoch
{
static readonly DateTime epochStart = new DateTime(1970, 1, 1, 0, 0, 0);
static readonly DateTimeOffset epochDateTimeOffset = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
@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 =
@jacobtoye
jacobtoye / gist:4748297
Created February 10, 2013 03:58
MultilineEntryElement for Monotouch.Dialog
using System;
using CrossUI.Touch.Dialog.Elements;
using System.Drawing;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using CrossUI.Touch.Dialog;
/// <summary>
/// Multiline entry element.
/// </summary>
// assumes variable data, which is a homogenous collection of objects
// get keys
var keys = _.keys(data[0]);
// convert to csv string
var csv = keys.join(",");
_(data).each(function(row) {
csv += "\n";
csv += _(keys).map(function(k) {