Skip to content

Instantly share code, notes, and snippets.

View zeekay's full-sized avatar
🔜

Zach Kelling zeekay

🔜
View GitHub Profile
@lonnen
lonnen / autoconf213.rb
Created January 4, 2011 22:15
Homebrew recipe for autoconf213
require 'formula'
class Autoconf213 <Formula
url 'http://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.13.tar.gz'
md5 '9de56d4a161a723228220b0f425dc711'
homepage 'http://www.gnu.org/software/autoconf/'
def keg_only?
:provided_by_osx
end
@erikfried
erikfried / README.markdown
Created March 7, 2011 10:21
shell script to invoke jslint via jsc on Mac OS X

I just realized that there is a rather well hidden javascript interpreter in the mac os x terminal out of the box. /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc See http://www.phpied.com/javascript-shell-scripting/

Then i figured it coud be quite easy to set up a command line util to run jslint from anywhere. Thought i´d share how.

Setup

@catalogchoice
catalogchoice / gist:934418
Created April 21, 2011 12:49
coffeescript name space
namespace = (target, name, block) ->
[target, name, block] = [(if typeof exports isnt 'undefined' then exports else window), arguments...] if arguments.length < 3
top = target
target = target[item] or= {} for item in name.split '.'
block target, top
@e000
e000 / donotuse.py
Created June 13, 2011 23:30
How to NEVER use lambdas.
##########################################################
# How to NEVER use Lambdas. An inneficient and yet educa-#
# tonal guide to the proper misuse of the lambda constru-#
# ct in Python 2.x. [DO NOT USE ANY OF THIS EVER] #
# by: e000 (13/6/11) #
##########################################################
## Part 1. Basic LAMBDA Introduction ##
# Well, it's worth diving straight into what lambdas are.
# Lambdas are pretty much anonymous "one line" functions
@almost
almost / models.coffee
Created November 26, 2011 20:02
The beginnings of a declarative model syntax for CoffeeScript.
# The beginnings of a declarative model syntax for CoffeeScript.
# SEE: http://almostobsolete.net/declarative-models-in-coffeescript.html
# Thomas Parslow
# Email: tom@almostobsolete.net
# Twitter: @almostobsolete
# The top part is the setup, see below that for the demo
# To see this run right away try copy pasting it into the 'Try
# CoffeeScript' box at http://jashkenas.github.com/coffee-script/
@plu
plu / znc_timestamp.pl
Created December 30, 2011 20:02
irssi: Reformat znc buffer playback messages
use strict;
use warnings;
use vars qw($VERSION %IRSSI);
$VERSION = '0.1';
%IRSSI = (
authors => 'Johannes Plunien',
contact => 'plu@pqpq.de',
description => 'Reformat znc buffer playback messages',
@Ivoz
Ivoz / rawr.py
Created February 6, 2012 10:08
import sys
import os
import fcntl
import gevent
from gevent import socket, queue
if __name__ == "__main__":
fcntl.fcntl(sys.stdin, fcntl.F_SETFL, os.O_NONBLOCK)
q = queue.Queue()
def rea():
@paulmillr
paulmillr / less.less
Created March 9, 2012 08:26
Sass vs Stylus vs LESS
.border-radius (@radius) {
-webkit-border-radius: @radius;
-o-border-radius: @radius;
-moz-border-radius: @radius;
-ms-border-radius: @radius;
border-radius: @radius;
}
.user-list {
// need to use special `.` syntax
@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@roxlu
roxlu / SSLBuffer.cpp
Created November 2, 2012 11:38
libuv + openssl + SSLBuffer
#include "SSLBuffer.h"
SSLBuffer::SSLBuffer()
:ssl(NULL)
,read_bio(NULL)
,write_bio(NULL)
,write_to_socket_callback(NULL)
,write_to_socket_callback_data(NULL)
,read_decrypted_callback(NULL)
,read_decrypted_callback_data(NULL)