This file contains hidden or 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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
$(function () { | |
function initialize() { | |
// Position map, center @ city center | |
var page_city_lat = $("#page_city_lat").text(); | |
var page_city_lng = $("#page_city_lng").text(); | |
var mapOptions = { | |
center: new google.maps.LatLng(page_city_lat, page_city_lng), | |
zoom: 11 | |
}; |
This file contains hidden or 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 'socket' | |
server = TCPServer.new(2000) | |
# An "echo server" read a single line of input from the client, echoes that | |
# input line back to the client, hangs up, and listens for a new connection. | |
def echo_prompt(client) | |
client.puts "Enter some input to echo" | |
input = client.gets.chomp |
This file contains hidden or 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 wonky_coins(n) | |
return 1 if n == 0 | |
# call wonky_coins from inside itself. This is called *recursion*. | |
return wonky_coins(n / 2) + wonky_coins(n / 3) + wonky_coins(n / 4) | |
end |
This file contains hidden or 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 'json' | |
require 'simple_oauth' | |
require 'excon' | |
require 'nokogiri' | |
require_relative 'lib/twitter_creds' | |
def post_tweet(string) | |
authorization_header = SimpleOAuth::Header.new("post", | |
"https://api.twitter.com/1.1/statuses/user_timeline.json", | |
{ :screen_name => "ugly_name", |
This file contains hidden or 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 'dotenv' | |
Dotenv.load | |
# Get these from https://apps.twitter.com/ in your applications API Keys tab. | |
API_KEY=ENV['API_KEY'] | |
API_SECRET=ENV['API_SECRET'] | |
ACCESS_TOKEN=ENV['ACCESS_TOKEN'] | |
ACCESS_TOKEN_SECRET=ENV['ACCESS_TOKEN_SECRET'] |
This file contains hidden or 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://i.imgur.com/mJcdyct.png | |
note: "brake" is an alias for "bundle exec rake" |
This file contains hidden or 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
# For the benefit of emacs users: -*- shell-script -*- | |
########################### | |
# xbindkeys configuration # | |
########################### | |
# | |
# Version: 1.8.6 | |
# | |
# If you edit this file, do not forget to uncomment any lines | |
# that you change. | |
# The pound(#) symbol may be used anywhere for comments. |
This file contains hidden or 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://www.powerthesaurus.org/ | |
https://github.com/sferik/active_emoji | |
https://jqplay.org | |
http://hey.sick.af/ | |
http://www.shittyusernames.com/ |
This file contains hidden or 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
$.fn.SPA = function( options ) { | |
// default settings | |
var settings = $.extend({ | |
toggling_sections: ".toggling", | |
base_link: "a[href^='#']", | |
}, options ); | |
// setup initial page layout | |
$(settings["toggling_sections"]).hide(); | |
// event listeners for links | |
$(settings["base_link"]).click(function(e){ |
OlderNewer