This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Solution for http://www.dailyperfect.com/jobs/ | |
# char msg_rot_something[] = {129, 146, 139, 158, 74, 147, 157, 74, 158, | |
# 146, 143, 74, 139, 152, 157, 143, 156, 74, 158, 153, 74, 158, 146, 143, | |
# 74, 155, 159, 143, 157, 158, 147, 153, 152, 74, 153, 144, 74, 150, 147, | |
# 144, 143, 86, 74, 159, 152, 147, 160, 143, 156, 157, 143, 74, 139, 152, | |
# 142, 74, 143, 160, 143, 156, 163, 158, 146, 147, 152, 145, 105, 74, 125, | |
# 143, 152, 142, 74, 163, 153, 159, 156, 74, 156, 143, 157, 154, 153, 152, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# (Potentially) finds Twitter users from your Delicious network | |
require 'rubygems' | |
require 'json' # sudo gem install json | |
require 'open-uri' | |
DELICIOUS_USERNAME = 'USERNAME' | |
DELICIOUS_API_BASE = 'http://feeds.delicious.com/v2/json/networkmembers/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# (Potentially) finds Delicious users from your Twitter network | |
require 'rubygems' | |
require 'json' # sudo gem install json | |
require 'open-uri' | |
TWITTER_USERNAME = 'USERNAME' | |
DELICIOUS_API_BASE = 'http://delicious.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Give me a username and how many days back you want me to search, | |
# and I'll tell you when this user last made a commit to a given repository. | |
# Deal? | |
# Usage: ./last_commit.rb -b 10 -u <SVN Username> -r http://svn/trunk | |
require 'rubygems' | |
require 'activesupport' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* gcc -lpthread -o thread-limit thread-limit.c */ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#define MAX_THREADS 10000 | |
int i; | |
void run(void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'socket' | |
class GetIP | |
def self.local_ip | |
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true | |
UDPSocket.open do |s| | |
s.connect '64.233.187.99', 1 # Relax, nothing is hitting the network | |
s.addr.last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Kernel#caller returns the current execution stack | |
class Stubby | |
def initialize | |
puts caller | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'rubygems' | |
require 'mechanize' | |
USERNAME = '<USERNAME>' | |
PASSWORD = '<PASSWORD>' | |
mech = Mechanize.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use | |
/Developer/Tools/SetFile -a V /opt | |
or | |
chflags hidden /opt | |
To revert: | |
chflags unhidden /opt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Blocks iTunes from launching if Spotify is open | |
# Installation: | |
# sudo ruby -e "$(curl -fsS https://raw.github.com/gist/613045/b12123d5e25d446038e6300bf54d2121bf180c34)" | |
blockers = ["Spotify"] | |
launch = true | |
blocker_name = "" |
OlderNewer