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 / nginx.conf
Created September 29, 2015 16:10 — forked from thewebfellas/nginx.conf
sample nginx.conf for thin
user nginx;
worker_processes 5;
error_log /var/log/nginx.error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@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,
@stephen-puiszis
stephen-puiszis / elasticsearch-cheatsheet.txt
Last active March 14, 2024 10:32
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# cat paths
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{index}
@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":
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
#!/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"
require "spec_helper"
describe ExampleController do
context "GET #index" do
let(:resources) { FactoryGirl.create_list(:resource) }
before do
get :index
end
@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'
@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 / 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()