Skip to content

Instantly share code, notes, and snippets.

View olivierphi's full-sized avatar

Olivier Philippon olivierphi

View GitHub Profile
I am the owner of lvh.me. And I'm glad to hear it's helpful. In truth, it's just a fancy DNS trick. lhv.me and all of it's sub-domains just point back to your computer (127.0.0.1). That means running ssl is as simple (or difficult) as running ssl on your computer.
I'm not sure how comfortable you are with the command line, but here's my how I setup my development environment. (rvm, passenger, nginx w/ SSL, etc).
# Install rvm (no sudo!)
# ------------------------------------------------------
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
source ~/.rvm/scripts/rvm
rvm install ree-1.8.7-2010.02
@ryanb
ryanb / railscasts_episodes.rb
Created June 4, 2012 06:01
Download source code for all RailsCasts episodes. You may want to cd into an empty directory first.
require "rubygems"
require "octokit" # gem install octokit
1.upto(5) do |page|
Octokit.repositories("railscasts", page: page, per_page: 100).each do |repo|
system "git clone git://github.com/railscasts/#{repo.name}"
end
end
@chrisguitarguy
chrisguitarguy / commandbus.py
Last active January 6, 2022 23:56
Command bus pattern in Python.
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Playing Around with the Command Bus Pattern in Python
"""
import inspect
import collections
@alexreardon
alexreardon / Native.js
Last active June 18, 2024 16:28
Some vanilla JS methods and patterns
// Native selectors.
(function(window, document) {
'use strict';
var noop = function() {
};
// DOCUMENT LOAD EVENTS
// not needed at the bottom of the page
document.addEventListener('DOMContentLoaded', noop);

Publishing an NPM package

Here's what I do when I publish an NPM package.

1: Make sure you're up to date

I always like to check what's going on in a repo before I do anything:

@unbracketed
unbracketed / branch-fu.md
Created April 7, 2015 17:49
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
@cimmanon
cimmanon / psql.md
Created May 2, 2017 17:22
PostgreSQL cheat sheet for MySQL users

I use PostgreSQL via the psql client. If you use a different client (eg. pgAdmin, etc.), I don't know how much will translate over.

One nice difference between psql and mysql (cli) is that if you press CTRL+C, it won't exit the client.

User administration

Login as superuser (via shell)

psql -U postgres
@roycewilliams
roycewilliams / pwnedpasswords-v2-top20k.txt
Last active May 29, 2024 07:42
pwnedpasswords-v2-top20k.txt
#------------------------------------------------------------------------------
# Top 20K hashes from the Troy Hunt / haveibeenpwned Pwned Passwords list v2 (2018-02-21)
# with frequency count and cracked plaintext passwords
#
# The latest version of this file can be found here:
# https://gist.github.com/roycewilliams/281ce539915a947a23db17137d91aeb7
#
# NOTE: THIS FILE IS DEPRECATED.
# The equivalent of this file, but based on v6 of the Pwned Passwords, is here:
# https://gist.github.com/roycewilliams/226886fd01572964e1431ac8afc999ce
@jacobwegner
jacobwegner / data-recovery-README.md
Last active January 30, 2024 06:29
Recovering data deleted via the Django admin

I was looking for a way to revert data deleted by mistake from the Django admin.

I reverse-engineered how Django's admin builds the list of objects displayed on the "Are you sure?" confirmation page.

Given a single obj or list of objs, the script included in this gist will:

  • Use the NestedObjects utility to determine the objects that would be deleted
  • Pass those objects to Django's JSON serializer
  • Write the objects to adeleted-objects fixture
@prologic
prologic / LearnGoIn5mins.md
Last active June 20, 2024 04:04
Learn Go in ~5mins