Skip to content

Instantly share code, notes, and snippets.

View jessewaites's full-sized avatar

Jesse Waites jessewaites

View GitHub Profile
@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 / {
@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
@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
@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
@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'
@sb8244
sb8244 / gist:351d6561b9617546fbb5
Created March 29, 2015 02:40
Grocer in action
DeviceNotifier = Struct.new(:message, :count) do
def call
notifications.each do |notif|
pusher.push(notif)
end
end
private
def pusher
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active July 17, 2025 23:11
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@almereyda
almereyda / falsehoods.md
Created April 14, 2016 15:11 — forked from wboykinm/falsehoods.md
Falsehoods programmers believe about addresses

Falsehoods programmers believe about addresses

This is an anchor-linked version of the excellent, amazing original opus magnum by Michael Tandy.

An address will start with, or at least include, a building number.

Counterexample: Royal Opera House, Covent Garden, London, WC2E 9DD, United Kingdom.

When there is a building number, it will be all-numeric.

Counterexample: 1A Egmont Road, Middlesbrough, TS4 2HT

@JasonTrue
JasonTrue / searchkick_and_elasticsearch_guidance.md
Last active March 11, 2025 03:37
Searchkick and Elastic Search guidance

Resources:

https://github.com/ankane/searchkick

Indexing

By default, simply adding the call 'searchkick' to a model will do an unclever indexing of all fields (but not has_many or belongs_to attributes).

In practice, you'll need to customize what gets indexed. This is done by defining a method on your model called search_data

def search_data

@peterc
peterc / Gemfile
Last active July 15, 2025 08:32
Example of releasing a tiny gem entire on Gist
source "https://rubygems.org"
gemspec