Skip to content

Instantly share code, notes, and snippets.

View stephen-puiszis's full-sized avatar

Stephen Puiszis stephen-puiszis

View GitHub Profile
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: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)
@stephen-puiszis
stephen-puiszis / analytics.js.coffee
Created October 18, 2014 18:23
Turbolinks / Google Analytics Integration using new analytics.js library. Uses Gon to pass Rails settings variables to the coffescript.
# google_analytics.js.coffee
class @GoogleAnalytics
@load: ->
window['GoogleAnalyticsObject'] = 'ga'
window['ga'] = window['ga'] || ->
(window['ga'].q = window['ga'].q || []).push arguments
window['ga'].l = 1 * new Date()
@stephen-puiszis
stephen-puiszis / rails-new
Last active August 29, 2015 14:09
New Rails App with Postgres, Skipping Test Unit and Bundle
rails new . --database=postgresql --skip-bundle -T
@stephen-puiszis
stephen-puiszis / missing_harvest_entries.rb
Created December 2, 2014 23:08
Find Your Missing Harvest Descriptions
require 'date'
require 'harvested'
class MissingHarvestEntries
attr_accessor :subdomain, :username, :password, :timesheet, :missing_entries, :start_date, :end_date
def initialize(start_date, end_date)
@subdomain = 'MY SUBDOMAIN'
@username = 'MY USERNAME'
@password = 'MY PASSWORD'
require "spec_helper"
describe ExampleController do
context "GET #index" do
let(:resources) { FactoryGirl.create_list(:resource) }
before do
get :index
end
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@stephen-puiszis
stephen-puiszis / ncaabb-rpi-2015.json
Last active August 29, 2015 14:20
NCAA Basketball 2015 RPI Rankings
[{"rpi":1,"name":"Kentucky","conference":"SEC","record":"34-0","wins":34,"losses":0},{"rpi":2,"name":"Villanova","conference":"BE","record":"32-2","wins":32,"losses":2},{"rpi":3,"name":"Kansas","conference":"B12","record":"26-8","wins":26,"losses":8},{"rpi":4,"name":"Wisconsin","conference":"B10","record":"31-3","wins":31,"losses":3},{"rpi":5,"name":"Arizona","conference":"P12","record":"31-3","wins":31,"losses":3},{"rpi":6,"name":"Duke","conference":"ACC","record":"29-4","wins":29,"losses":4},{"rpi":7,"name":"Virginia","conference":"ACC","record":"29-3","wins":29,"losses":3},{"rpi":8,"name":"Gonzaga","conference":"WCC","record":"31-2","wins":31,"losses":2},{"rpi":9,"name":"Iowa St.","conference":"B12","record":"25-8","wins":25,"losses":8},{"rpi":10,"name":"Baylor","conference":"B12","record":"23-9","wins":23,"losses":9},{"rpi":11,"name":"North Carolina","conference":"ACC","record":"24-11","wins":24,"losses":11},{"rpi":12,"name":"SMU","conference":"Amer","record":"26-6","wins":26,"losses":6},{"rpi":13,"name":
@stephen-puiszis
stephen-puiszis / development.rb
Created September 11, 2015 21:51
Rails 4.x - The proper way to send emails in development environments using gmail SMTP
config.action_mailer.default_url_options = { host: "localhost:3000" }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "domain.com",
user_name: "email@domain.com",
password: "password",
authentication: :login,
enable_starttls_auto: true,