- Build.
- Blog.
- Bresent.
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
var toRoman = function(num){ | |
var range, numerals, roman_numeral, i; | |
range = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]; | |
numerals = "M CM D CD C XC L XL X IX V IV I".split(" "); | |
roman_numeral = ""; | |
for(i=0;i<range.length;i++){ | |
while(num >= range[i]){ | |
num -= range[i]; |
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
# Substitute Postgres.app/Contents/Versions/9.3 with appropriate version number | |
sudo ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config |
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
name = "Sharnie Ivery" | |
<<-GREET | |
Hello, #{name} | |
GREET | |
# => "Hello, Sharnie Ivery" |
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
name = "Sharnie Ivery" | |
<<-'GREET' | |
Hello, #{name} | |
GREET | |
# => "Hello, #{name}" |
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
name = "Sharnie Ivery" | |
<<-`GREET` | |
hostname | |
whoami | |
GREET | |
# => "sharnieivery" |
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
Sublime Text 2 - Useful Shortcuts | |
================================= | |
*Tested in Mac OS X: super == command* | |
Open/Goto | |
_________ | |
- super+t: go to file | |
- super+ctrl+p: go to project | |
- super+r: go to methods |
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
for(var i = 1; i <= 20; i++) { | |
if( i % 3 === 0 && i % 5 === 0 ) { | |
console.log( "FizzBuzz" ); | |
} else if( i % 3 === 0 ) { | |
console.log( "Fizz" ); | |
} else if( i % 5 === 0 ) { | |
console.log( "Buzz" ); | |
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
#outer { | |
width: 100%; | |
text-align: center; | |
} | |
#inner { | |
display: inline-block; | |
} |
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
class SearchController < ApplicationController | |
def index | |
access_token = "YOUR ACCESS TOKEN HERE" # should have been session[:access_token]. Never store credentials in your code | |
client = Instagram.client(access_token: access_token) | |
geocoder = Geocoder.search(params[:q] || "brooklyn, new york") | |
lat = geocoder.first.data["geometry"]["location"]["lat"] | |
lng = geocoder.first.data["geometry"]["location"]["lng"] | |
@results = client.location_search(lat, lng) | |
end | |
end |