Skip to content

Instantly share code, notes, and snippets.

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@aolshevskiy
aolshevskiy / build.gradle
Created January 21, 2012 15:35
Hello World Netty Http Server
apply plugin: "java"
apply plugin: "eclipse"
repositories {
mavenCentral()
}
dependencies {
compile (
"org.jboss.netty:netty:latest.integration",
@brosner
brosner / gist:1107302
Created July 26, 2011 17:35
OS X Setup

My OS X Setup

I recently bought a Macbook Air 1.8 GHz i7 with OS X 10.7. I decided to document the exact apps I've installed for my personal use and for others to see what I use.

This list is never complete. It will continue to evolve as I installed stuff for myself and find stuff over time. Recommendations welcome :-)

MAS

@technoweenie
technoweenie / pinger.rb
Created June 17, 2011 14:38
ZeroMQ pub/sub demo
require 'zmq'
context = ZMQ::Context.new
pub = context.socket ZMQ::PUB
pub.setsockopt ZMQ::IDENTITY, 'ping-pinger'
pub.bind 'tcp://*:5555'
i=0
loop do
pub.send "ping pinger #{i+=1}" ; sleep 1
end
@stevestreza
stevestreza / MWMacros.h
Created April 17, 2011 16:42
Some convenience macros for common types of objects in ObjC
#define MWDict(...) ((NSDictionary *)[NSDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil])
#define MWArray(...) ((NSArray *)[NSArray arrayWithObjects:__VA_ARGS__, nil])
#define MWSet(...) ((NSSet *)[NSSet setWithObjects:__VA_ARGS__, nil])
#define MWURL(str, ...) ((NSURL *)[NSURL URLWithString:[NSString stringWithFormat:(str), ##__VA_ARGS__]])
#define MWString(str, ...) ((NSString *)[NSString stringWithFormat:(str), ##__VA_ARGS__])
@stephenmcd
stephenmcd / nonblocking.py
Created December 31, 2010 23:29
Threaded function decorator
import functools
import thread
def nonblocking(func):
"""
Decorator that runs the given func in a separate thread
when called, eg::
@nonblocking
def some_blocking_func():
# Apache conf (/etc/apache2/apache2.conf)
#
# Based on http://github.com/jacobian/django-deployment-workshop/
# blob/master/apache/apache2.conf by Jacob Kaplan-Moss
# Basic server setup
#
ServerRoot "/etc/apache2"
PidFile ${APACHE_PID_FILE}
User ${APACHE_RUN_USER}
require 'formula'
class Cpansearch <Formula
head 'http://github.com/c9s/cpansearch.git', :using => :git
homepage 'http://github.com/c9s/cpansearch'
# Don't take +x off these files
skip_clean 'bin'
# uses libcurl (system)
# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)
@edwardgeorge
edwardgeorge / gist:544112
Created August 22, 2010 18:34
fix for macfuse installation on snow leopard if you're encountering Input/Output errors.
--- /usr/local/lib/pkgconfig/fuse.pc
+++ /usr/local/lib/pkgconfig/fuse.pc
@@ -6,5 +6,5 @@
Name: fuse
Description: File System in User Space (MacFUSE)
Version: 2.7.3
-Libs: -L${libdir} -lfuse -pthread -liconv
+Libs: -L${libdir} -lfuse_ino64 -pthread -liconv
Cflags: -I${includedir}/fuse -D__FreeBSD__=10 -D_FILE_OFFSET_BITS=64