Skip to content

Instantly share code, notes, and snippets.

View dustym's full-sized avatar
🏈

Dusty Matthews dustym

🏈
View GitHub Profile
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist
@dustym
dustym / graphite.rb
Created June 8, 2012 03:47 — forked from joakimk/graphite.rb
Graphite client for ruby with specs
require 'socket'
class Graphite
def initialize(host)
@host = host
end
def socket
return @socket if @socket && [email protected]?
@socket = TCPSocket.new(@host, 2003)
class Constants
@myConst: () -> "Hello"
exports.Constants = Constants
@dustym
dustym / pinboardaday.py
Created November 11, 2010 03:48
Uses the deliciousapi library to grab a random saved pinboard.in url and pop it into instapaper. Needs the version of deliciousapi.py with the modified pinboard.in api endpoint at https://gist.github.com/671964/e592caf3732a35241b980866c386a58aff2e65a9
import deliciousapi
import random
import urllib
import ConfigParser
import os.path
class RandomDeliciousLink(object):
def __init__(self, pinboard_username, pinboard_password,
instapaper_username, instapaper_password):
self.pinboard_username = pinboard_username
trapper:ext dusty$ make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -DHAVE_RUBY_H -DHAVE_ASPELL_H -I/opt/local/include -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -c raspell.c
cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup -o raspell.bundle raspell.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/lib -L. -arch ppc -arch i386 -lruby -laspell -lpthread -ldl -lm
ld warning: in /opt/local/lib/libaspell.dylib, file is not of required architecture
trapper:ext dusty$ which ruby
/usr/bin/ruby
trapper:ext dusty$ ruby
Makefile extconf.rb mkmf.log raspell.bundle raspell.c raspell.h raspell.o
trapper:ext dusty$ irb
irb(main):001:0> require 'raspell'
# .irbrc
# <snip>
class Object
def self.pbcopy(val)
IO.popen('pbcopy','w') {|pb| pb << val }
end
def pbcopy
var CurbedNetwork = $H({
'curbed.com': $H({
title: 'curbed',
locale: 'ny',
name: 'Curbed',
email: '[email protected]'
}),
'eater.com': $H({
title: 'eater',
locale: 'ny',
$('#file').change(function() {
$("#uploader").ajaxForm({iframe: true, success: success}).submit();
})
// ==UserScript==
// @name Fix tabs in gist paste.
// @namespace Gist
// @description nukes tabs
// @include http://gist.github.com/
// ==/UserScript==
var jQuery = unsafeWindow.jQuery;
$ = jQuery
$('.paste').prepend('<a href="#" id="fix_the_fucking_tabs">fix the fucking tabs</a>');
use Cache::Memcached;
use IO::Socket::INET;
my $testaddr = "127.0.0.1:22122";
my $msock = IO::Socket::INET->new(PeerAddr => $testaddr,
Timeout => 3);
my $memd = Cache::Memcached->new({
servers => [ $testaddr ]
});