Skip to content

Instantly share code, notes, and snippets.

👻
test status

Jesse Aldridge JesseAldridge

View GitHub Profile
@codediodeio
codediodeio / database.rules.json
Last active Apr 12, 2019
Common Database Rules for Firebase
View database.rules.json
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@pch
pch / mac-vagrant-unison.md
Last active Feb 18, 2019
How to install Unison on Mac OS El Capitan & Vagrant
View mac-vagrant-unison.md

How to install Unison on Mac OS El Capitan & Vagrant - for Docker Sync

You can install Unison on the Mac via homebrew (brew install unison), but it's very likely that it won't work properly, resulting in errors like:

Unison failed: Uncaught exception Failure("input_value: bad bigarray kind")
Fatal error: Lost connection with the server
@tothebeat
tothebeat / Makefile
Last active Nov 28, 2018
Periodic Screenshots (every 10 seconds) on Mac OS X
View Makefile
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " screencap To start recording screencaps and clean up yesterday's captures."
@echo " cleanyesterday Just delete yesterday's captures."
@echo " captoday Just start recording screencaps for today."
screencap:
./remove_yesterday_recording.sh
./start_recording.sh
@inklesspen
inklesspen / post-checkout.py
Created Jun 10, 2014
Post-checkout hook to detect alembic issues when switching branches.
View post-checkout.py
#!/usr/bin/env python
"""
Provide useful alembic information after switching branches.
"""
import argparse
import subprocess
import os
import os.path
import py.path
@XVilka
XVilka / TrueColour.md
Last active Apr 19, 2019
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@Terrance
Terrance / Shlex.js
Last active Sep 4, 2016
A function for parsing shell-like quoted arguments into an array, similar to Python's shlex.split. Also allows quotes mid-way through a string, and parses them out for you. Returns false on failure (from unbalanced quotes).
View Shlex.js
function shlex(str) {
var args = str.split(" ");
var out = [];
var lookForClose = -1;
var quoteOpen = false;
for (var x in args) {
if (args.hasOwnProperty(x)) {
var arg = args[x];
var escSeq = false;
for (var y in arg) {
@richardhsu
richardhsu / so_xml2sql.py
Created Dec 13, 2012
XML to SQL converter for Stack Overflow XML data dump files. For newer versions of MySQL you can use the LOAD XML and it can work out but for older versions this script can help.
View so_xml2sql.py
#!/usr/bin/env python
""" Stack Overflow XML 2 SQL
The following is a custom made XML 2 SQL converter for Stack Overflow data.
Latest Stack Overflow Data: August 2012
Call Examples:
@jpennell
jpennell / fabfile.py
Created Sep 18, 2012
Fabric fabfile for Django/Heroku App
View fabfile.py
from fabric.api import env, local, require
def deploy():
"""fab [environment] deploy"""
require('environment')
maintenance_on()
push()
syncdb()
migrate()
@fnielsen
fnielsen / gist:1226214
Created Sep 19, 2011
Email classification example with Python, NLTK, ...
View gist:1226214
documents = [ dict(
email=open("conference/%d.txt" % n).read().strip(),
category='conference') for n in range(1,372) ]
documents.extend([ dict(
email=open("job/%d.txt" % n).read().strip(),
category='job') for n in range(1,275)])
documents.extend([ dict(
email=open("spam/%d.txt" % n).read().strip(),
category='spam') for n in range(1,799) ])
@benatkin
benatkin / Global.sublime-settings
Created Jul 20, 2011
excluding node_modules from Sublime Text 2
View Global.sublime-settings
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
You can’t perform that action at this time.