Skip to content

Instantly share code, notes, and snippets.

View stephen-puiszis's full-sized avatar

Stephen Puiszis stephen-puiszis

View GitHub Profile
@stephen-puiszis
stephen-puiszis / gist:522ebdd15849bc8e0000
Created September 23, 2014 00:09
Read a Sitemap.xml file and save any links to a file in that same directory. Then CURL every link from that file to read headers. Best used to quickly verify your site map is returning 200s.
grep <sitemap file> --only-matching -E -e 'http(s?):\/\/[^ \"\(\)\<\>]*' >> links.txt
for i in `cat links.txt` ; do curl -I $i ; done (edited)
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@stephen-puiszis
stephen-puiszis / gist:5589117
Created May 16, 2013 03:08
Seeds file for database
# --- Seeds the State Database ---- #
states = {
'ABA'=> 'American Bar Association',
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
@stephen-puiszis
stephen-puiszis / gist:5560863
Created May 11, 2013 18:15
Crunchbase Individuals
#----- Individuals------#
require 'open-uri'
require 'json'
base_url = "http://api.crunchbase.com/v/1/"
key = "atsvjzz7q9apzywd9ex3t67e"
api_key = "&api_key=#{key}"
people = "people.js?"
data = JSON.parse(open(base_url+people+api_key).read)
@stephen-puiszis
stephen-puiszis / gist:5453334
Created April 24, 2013 16:07
Seed file for skeleton apps (Shaq GIFs)
pictures = [
{ :url => "http://i.cdn.turner.com/dr/teg/coco/release/sites/default/files/0229_ShaqRoar.gif", :name => "Shaq", :caption => "Shaq is going to eat Conan" },
{ :url => "http://i.imgur.com/AvKuM6i.gif", :name => "Shaq being Shaq", :caption => "Awesome" },
{ :url => "http://instntrply.com/wp-content/uploads/2011/12/shaqtree.gif", :name => "Christmas Tree", :caption => "TNT" },
]
pictures.each do |pic|
p = Picture.new
p.name = pic[:name]
p.url = pic[:url]
@stephen-puiszis
stephen-puiszis / gist:5360155
Created April 11, 2013 02:22
Facebook API Demo
require 'open-uri'
require 'json'
your_access_token = "put your access token from the Graph API Explorer here"
url = "https://graph.facebook.com/me/home?fields=from,picture,link,source,name,description,type&access_token=#{your_access_token}"
result = JSON.parse(open(url).read)
posts = result["data"]