Skip to content

Instantly share code, notes, and snippets.

Sharnie Ivery sharnie

Block or report user

Report or block sharnie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View querySelector.polyfill.js
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,600);
body {
background-color: #2ecc71;
View location_search_instagram.rb
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
View gist:9486321519c39574305c
#outer {
width: 100%;
text-align: center;
}
#inner {
display: inline-block;
}
View fizz_buzz.js
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" );
View interview_prep.md

Interview Prep

General Thoughts for Interviewing

Three Primary Responsibilities

  • Build.
  • Blog.
  • Bresent.

Problem Solving

"Make it work, make it right, make it fast."

View Sublime Text Shortcut
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
View heredoc_shell_command.rb
name = "Sharnie Ivery"
<<-`GREET`
hostname
whoami
GREET
# => "sharnieivery"
View heredoc_no_interpolation.rb
name = "Sharnie Ivery"
<<-'GREET'
Hello, #{name}
GREET
# => "Hello, #{name}"
View heredoc_interpolation.rb
name = "Sharnie Ivery"
<<-GREET
Hello, #{name}
GREET
# => "Hello, Sharnie Ivery"
You can’t perform that action at this time.