Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active April 13, 2025 15:46
The introduction to Reactive Programming you've been missing
@prichey
prichey / rainbow_wbc.py
Last active November 3, 2016 05:07
Comment heart emoji on WBC's most recent Vine video
import vinepy
def main():
vine = vinepy.API(username='XXXXX@XXXX.XXX', password='XXXXXXXX')
#say hello to westboro baptist
wbc_id = 984602341204725760
wbc_timeline = vine.get_user_timeline(user_id = wbc_id)
post = wbc_timeline[0]
@lfender6445
lfender6445 / gist:9919357
Last active April 11, 2025 19:56
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@davoclavo
davoclavo / inverted_internet.py
Last active November 22, 2021 15:50
Inverted internet for mitmproxy
#!/usr/bin/env python
"""
Inject inverting css
Usage:
inverted_internet
"""
from libmproxy import controller, proxy
import os
import sys
@gavinandresen
gavinandresen / brainwallets.md
Created October 5, 2012 14:57
brainwallet brain dump
@asimpson
asimpson / gist:3813853
Last active October 11, 2015 05:58
Exclude sublime workspace and project files from sublime sidebar
{
"folders":
[
{
"file_exclude_patterns":
[
"*.sublime-*"
],
"folder_exclude_patterns":
[
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 15, 2025 08:03
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@avibryant
avibryant / gist:3200554
Created July 29, 2012 17:47
The Regex Game
The Regex Game
Avi Bryant
This is a game for two programmers, although it's easy to imagine variations for more.
It can be played over email, twitter, or IM, but it's easy to imagine a custom web app for it, and I encourage someone to build one.
Each player starts by thinking of a regular expression. The players should decide beforehand on dialect and length restrictions (eg, has to be JavaScript-compatible and under 20 characters).
They don't reveal the Regex, but if playing over email etc, should send each other a difficult to brute force hash (eg bcrypt) of the Regex for later verification.
They do reveal two strings: one which the Regex will match, and one which it will not.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 14, 2025 16:53
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one