This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
require 'optparse' | |
options = {} | |
# Create new options parser | |
OptionParser.new do |opt| | |
# Set the help message banner | |
opt.banner = "Usage: #{opt.program_name}.rb [options]" |
v=0473;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP | |
4ZojjV)O>qIH1/n[|2yE[>:ieC "###%.#% ::" 97N-A&Kj_K_><wS5rtWk@*a+Y5 | |
yH?b[F^e7C/56j|pmRe+:)B "#####%##. .:#####" O98(Zh)'Iof*nm.,$C5Nyt= | |
PPu01Avw^<IiQ=5$'D-y? "#####%###: ########" g6`YT+qLw9k^ch|K'),tc | |
6ygIL8xI#LNz3v}T=4W "%######## #. .####" lL27FZ0ij)7TQCI)P7u | |
}RT5-iJbbG5P-DHB<. " :####### ##### # :###" R,YvZ_rnv6ky-G+4U' | |
$*are@b4U351Q-ug5 " :### : :#############" 00x8RR%`Om7VDp4M5 | |
PFixrPvl&<p[]1IJ " %#... ############:##" EGgDt8Lm#;bc4zS^ | |
y]0`_PstfUxOC(q " .###: %############:##" /,}.YOIFj(k&q_V | |
zcaAi?]^lCVYp!; " :. %% .################" ;s="v=%04o;ev"% |
# I am currently using this script with with Capistrano v2.15.5 | |
# for deployment of Rails 3.2.13 and Rails 4.0.0 applications on | |
# Passenger 4.0.7 with nginx/1.4.1. | |
require "rvm/capistrano" | |
set :rvm_ruby_string, 'default' | |
require "bundler/capistrano" | |
# Set application and username | |
set :application, "application-name.com" |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
require 'benchmark' | |
n = 10_000_000 | |
puts "\nGenerating random string of length #{n}:" | |
Benchmark.bm(9) do |x| | |
x.report('Method 1: ') do | |
range = [('a'..'z'),('A'..'Z'),('0'..'9')].map{ |i| i.to_a }.flatten | |
(0...n).map{ range[rand(range.length)] }.join |
try | |
set network_location to do shell script ("scselect | awk '{if ($1==\"*\") print $3}' | sed 's/[()]//g'") | |
on error | |
display dialog "There was an error with the script." | |
end try | |
if network_location is "LocationA" then | |
do shell script "scselect LocationB" | |
else if network_location is "LocationB" then | |
do shell script "scselect LocationA" |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
require 'sinatra' | |
require 'instagram_api' | |
# Go to http://instagram.com/developer to get your client ID and client secret. | |
CLIENT_ID = "YOUR CLIENT ID" | |
CLIENT_SECRET = "YOUR CLIENT SECRET" | |
# Set the redirect uri for your application to the following: | |
REDIRECT_URI = "http://localhost:4567/callback" |
import com.mongodb.MongoClient; | |
import com.mongodb.DB; | |
import com.mongodb.DBCollection; | |
import com.mongodb.BasicDBObject; | |
import com.mongodb.DBObject; | |
import com.mongodb.DBCursor; | |
import java.net.UnknownHostException; | |
import java.util.ArrayList; | |
import java.util.Set; |
Set oWMP = CreateObject("WMPlayer.OCX.7") | |
Set colCDROMs = oWMP.cdromCollection | |
wscript.sleep 600000 | |
do | |
if colCDROMs.Count >= 1 then | |
For i = 0 to colCDROMs.Count - 1 | |
colCDROMs.Item(i).Eject | |
Next | |
For i = 0 to colCDROMs.Count - 1 | |
colCDROMs.Item(i).Eject |