Skip to content

Instantly share code, notes, and snippets.

View stephen-puiszis's full-sized avatar

Stephen Puiszis stephen-puiszis

View GitHub Profile
#!/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 / 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 / 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 / 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 / git-cleanup
Created February 25, 2016 17:28
Delete Local Git Branches that have been merged into develop
git branch --merged develop | grep -v '\* develop' | xargs -n 1 git branch -d
@stephen-puiszis
stephen-puiszis / digital_ocean_setup.md
Created May 11, 2016 02:00 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@stephen-puiszis
stephen-puiszis / rails_helper.rb
Last active June 2, 2016 22:34
Automatically take full page screenshots of failed Capybara test failures in RSpec 3
# rails_helper.rb
RSpec.configure do |config|
# other config
config.after(:each, js: true) do |example|
if example.exception
meta = example.metadata
name = "test-failure-#{File.basename(meta[:file_path])}-#{meta[:line_number]}.png"
@stephen-puiszis
stephen-puiszis / gist:793a62b3ed2cc014bace4e4cd67fc3b4
Last active October 12, 2016 00:49
install gzipped tars on a remote linux server
wget http:/url-to-tar/jpegotpim-1.4.4.tar.gz
zcat jpegoptim-1.4.4.tar.gz | tar xf -
cd jpegoptim-1.4.4
./configure
make
make strip
make install