Skip to content

Instantly share code, notes, and snippets.

View jessewaites's full-sized avatar

Jesse Waites jessewaites

View GitHub Profile
@duplamatyi
duplamatyi / string_concat_benchmark.rb
Last active August 29, 2015 14:17
Ruby String Concat Benchmark Fun
require 'benchmark'
iterations = 100000
api_base = 'https://api.example.com'
api_version = 'v1'
rest_url = 'resource'
puts 'Ruby String Concat Benchmark Fun'
@dideler
dideler / upgrade-postgres-9.3-to-9.4.md
Last active December 13, 2024 20:18
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10

TL;DR

Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active June 23, 2025 13:24
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@gabebw
gabebw / modules_and_inheritance.rb
Last active August 29, 2015 14:04
Exploring modules and inheritance in Ruby
module ModuleOne
def name
"Module 1"
end
end
module ModuleTwo
def name
"Module 2"
end
@kyledrake
kyledrake / ferengi-plan.txt
Last active July 23, 2025 20:52
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 24, 2025 13:35
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

anonymous
anonymous / A-simple-CSS-Card-Flip.markdown
Created May 1, 2014 02:29
A Pen by Mandy Thomson.

A simple CSS Card Flip

Just wanted to try out a simple css flip. This was also my first time using Bourbon, but it certainly will not be my last. I will use it on all future projects.

A Pen by Mandy Thomson on CodePen.

License.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" >
$(window).load(function() {
$("#navFill").height($("#contentWrapper").height()-558);
});
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
kkeys.push( e.keyCode );
@dmshvetsov
dmshvetsov / seed.rb
Last active June 1, 2019 15:29
How to seed your database with JSON/YAML. Source http://snippets.aktagon.com
json = ActiveSupport::JSON.decode(File.read('db/seeds/countries.json'))
json.each do |a|
Country.create!(a['country'], without_protection: true)
end
@PWSdelta
PWSdelta / rspec_model_testing_template.rb
Last active July 29, 2025 13:52
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# This skeleton also assumes you're using the following gems:
#
# rspec-rails: https://github.com/rspec/rspec-rails