Skip to content

Instantly share code, notes, and snippets.

View blairanderson's full-sized avatar

Blair Anderson blairanderson

View GitHub Profile
@blairanderson
blairanderson / rs-iframe.md
Created March 27, 2015 01:22
repairshopr

our widget is an iframes, and can only do what your site allows

the iframe cannot make your page taller, but you can make your page taller and the iframe will expand down.

Try this:

.rs-widget-container {
 position: relative;
@blairanderson
blairanderson / pr-template.md
Last active August 29, 2015 14:18
PR template

What's this PR do?

  • awesome stuff
  • really cool feature
  • refactor X

Where should the reviewer start?

  • start on the application_controller.rb
@blairanderson
blairanderson / fb_twttr_meta.md
Last active August 29, 2015 14:18
Facebook and Twitter Meta Data

facebook - https://developers.facebook.com/docs/sharing/best-practices#tags

<meta property="og:title" content="Facebook Open Graph META Tags"/>
<meta property="og:image" content="http://example.com/assets/img/logo_for_facebook.png"/>
<meta property="og:site_name" content="Some Awesome Website"/>
<meta property="og:description" content="Facebook's Open Graph protocol allows for web developers to turn their websites into Facebook "graph" objects, allowing a certain level of customization over how information is carried over from a non-Facebook website to Facebook when a page is 'recommended', 'liked', or just generally shared."/>
@blairanderson
blairanderson / side-toggle.md
Created April 11, 2015 02:17
Code example for an easy toggle sidebar

styles:

  #slideout {
    width: 300px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
 background: white;
@blairanderson
blairanderson / rubymine-shortcuts.md
Last active September 24, 2015 13:13
rubymine shortcuts(helping me remember them!)
  • JSdoc style comments for functions...

    • in front of the method declaration type /** and in enter
  • shift + return => inserts a new line and uses smart indentation to place the cursor

  • shift + command + u => toggles from upcase to downcase, and downcase to upcase

  • shift + option + u => toggles from snake to camel and camel to snake

  • Live Templates are Atom Snippets!

  • option + enter/return => intents will show possible actions to take on that item

@blairanderson
blairanderson / JStwitter.rb
Created June 7, 2012 03:22
This is a JStwitter client lesson
require 'jumpstart_auth'
class JSTwitter
attr_reader :client
def run
puts "Welcome to the JSL Twitter Client!"
command = ""
while command != "q"
printf "enter command: "
@blairanderson
blairanderson / home-buying-101
Created October 25, 2012 03:23
Checklist for Buying a Home
Home Buying Checklist
Property Address
Asking Price
Real Estate Taxes
The Neighborhood
Near Work
Near Schools
Near Shopping
Near Expressways
Near Public Transportation
(1..100).each do |each|
if each % 3 == 0 and each % 5 == 0
puts "FizzBuzz"
elsif each % 3 == 0
puts "Fizz"
elsif each % 5 == 0
puts "Buzz"
else
puts each
end
@blairanderson
blairanderson / gist:4719918
Created February 6, 2013 03:12
to create an array of hashes
def parse_file(filename)
@people = []
@contents.each do |row|
person = {}
person[:id] = row[0]
person[:regdate] = row[:regdate]
person[:first_name] = clean_first_name(row[:first_name])
person[:last_name] = clean_last_name(row[:last_name])
person[:email] = clean_email(row[:email_address])
person[:phone] = clean_phone(row[:homephone])
@blairanderson
blairanderson / gist:4736331
Last active December 12, 2015 07:28
Before and After!
#------------------BEFORE----------------------------
def width #column width for 'queue print'
first_name_length = [12]
last_name_length = [12]
email_length = []
city_length = []
street_length = []
@queue.each do |person|
first_name_length << person[:first_name].length
last_name_length << person[:last_name].length