Skip to content

Instantly share code, notes, and snippets.

View clarete's full-sized avatar
🌴
On vacation

Lincoln Clarete clarete

🌴
On vacation
View GitHub Profile

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@mauvm
mauvm / Jasmine-and-Babel6.md
Created November 12, 2015 10:51
Jasmine ES6 run script for use with Babel 6
$ npm install --save babel-cli babel-preset-es2015
$ npm install --save-dev jasmine

.babelrc:

{
 "presets": ["es2015"]
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@jtriley
jtriley / ec2-fingerprint-key
Created November 1, 2013 19:28
Simple Python script that computes both public and private RSA key fingerprints as used by Amazon EC2
#!/usr/bin/env python
import hashlib
import optparse
import paramiko
from Crypto.PublicKey import RSA
def insert_char_every_n_chars(string, char='\n', every=64):
return char.join(
@kujohn
kujohn / portforwarding.md
Last active January 21, 2022 02:36
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
#!/usr/bin/env escript
-mode(compile).
epoch() ->
{Mega,Sec,Mili} = os:timestamp(),
(Mega * 1000000) + Sec + (Mili / 1000000).
measure(F) ->
Ini = epoch(),
#!/usr/bin/env escript
epoch() ->
{Mega,Sec,Mili} = now(),
(Mega * 1000000) + Sec + (Mili / 1000000).
measure(F) ->
Ini = epoch(),
F(),
epoch() - Ini.
@r10r
r10r / enable_dnsmasq_on_osx.sh
Last active October 11, 2019 04:27
Installs and configures dnsmasq on osx (for local resolution of development machines e.g virtualbox). Cudos to Alan Ivey http://www.echoditto.com/blog/never-touch-your-local-etchosts-file-os-x-again
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for vbox domain
# ----------------------
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/vbox'
@Bpless
Bpless / shell_plus_reloader.py
Last active June 5, 2018 11:40
Shell_Plus reloader thread
class ReloaderEventHandler(FileSystemEventHandler):
"""
Listen for changes to modules within the Django project
On change, reload the module in the Python Shell
Custom logic required to reload django models.py modules
Due to the singleton AppCache, which caches model references.
For those models files, we must clear and repopulate the AppCache
"""
def __init__(self, *args, **kwargs):