Skip to content

Instantly share code, notes, and snippets.

@JakeWharton
JakeWharton / hookpuller.py
Created November 7, 2009 00:57
Takes a GitHub service hook POST and automatically updates the associated repo.
#!/usr/bin/env python
'''
Takes a GitHub service hook POST and automatically updates the associated repo.
'''
__license__ = '''
Copyright 2009 Jake Wharton
hookpuller is free software: you can redistribute it and/or modify
@JakeWharton
JakeWharton / Impersonator.cs
Created November 5, 2009 15:26
Allows you to execute code under another user's privileges.
using System;
using System.Runtime.InteropServices;
using System.Security.Principal;
namespace JakeWharton
{
public class Impersonator : IDisposable
{
private WindowsImpersonationContext ImpersonatedUser = null;
private IntPtr UserHandle;
@JakeWharton
JakeWharton / gist:154713
Created July 25, 2009 06:08
Rudimentary implementation of pyy_tag/html_tag in C#
using System;
using System.Text;
using System.Reflection;
namespace pyysharp
{
public abstract class HtmlTag
{
private static string TAB = " ";
@JakeWharton
JakeWharton / seven_seg.py
Created April 14, 2009 18:43
Python function to generate seven-segment number strings. Derived from Knio.
def seven_seg(x):
'''
_ _ _ _ _ _ _ _
|_||_| ||_ |_ |_| _| _| || |
_||_| ||_| _| | _||_ ||_|
1111101101 = 1005
1101110001 = 881
1101111100 = 892