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
require "rubygems" | |
require "google_calendar" | |
require "date" | |
require "prime" | |
# Create an instance of the calendar. | |
cal = Google::Calendar.new(:client_id => "foo" | |
:client_secret => "bar", | |
:calendar => "blee", |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>~crm</title> | |
<style> | |
body { | |
max-width: 600px; | |
margin: 0 auto; |
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
Believe It | |
Hard to believe that, after all of it, | |
in bed for good now, knowing you haven’t done | |
one thing of any lasting benefit |
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
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport |
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
def doctorize(string) | |
string.gsub(/M(iste)?r/, 'Mister' => 'Doctor', 'Mr' => 'Dr') | |
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
# http://batsov.com/articles/2013/08/30/using-gsub-with-a-block/?utm_source=rubyweekly&utm_medium=email | |
# num will be passed the string '12' | |
"Apollo 12".gsub(/\d+/) { |num| num.to_i.next } | |
# => "Apollo 13" | |
# string yielded to block is always entire match; can't do matched groups at |m1, m2| etc. |
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
// this is the part i always use | |
$.ajax = function(url, callback) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", url, true); | |
xhr.onload = callback; | |
xhr.send(); | |
} |
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 'rubygems' | |
require 'numbers_and_words' | |
VOWELS = ['a','e','i','o','u'] | |
CONSONANTS = ('a'..'z').to_a.delete_if do |char| | |
VOWELS.include?(char) | |
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 | |
require 'rubygems' | |
require 'twitter' | |
require 'json' | |
require 'faraday' | |
TWITTER_USER = "your_username_here" | |
TIMEOUT = 1 # increment this if you're getting a lot of rate limit errors | |
# get these from dev.twitter.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 | |
require 'rubygems' | |
require 'twitter' | |
require 'json' | |
require 'faraday' | |
TWITTER_USER = "blahblah" | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "blahblah" |