Skip to content

Instantly share code, notes, and snippets.

View vincentmac's full-sized avatar

Vincent Mac vincentmac

View GitHub Profile
@vincentmac
vincentmac / #!: forever post-receive
Created April 2, 2012 22:38
#!: forever post-receive
#!/bin/sh
GIT_WORK_TREE=/var/www/simplicity.io
export GIT_WORK_TREE
git checkout -f
forever stop 0
NODE_ENV=production forever start /var/www/simplicity.io/app.js
@vincentmac
vincentmac / gist:2299265
Last active January 6, 2023 18:24
Android: Chrome USB Debugging
In terminal type:
adb forward tcp:9222 localabstract:chrome_devtools_remote
Open desktop Chrome and navigate to:
localhost:9222
https://developers.google.com/chrome-developer-tools/docs/remote-debugging
# ZSH Theme emulating the Fish shell's default prompt.
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
echo ':'
#echo '○'
}
local user_color='magenta'; [ $UID -eq 0 ] && user_color='red'
@vincentmac
vincentmac / Vincent_SublimeCustom.tmTheme
Created July 9, 2012 20:22
sublime: enlightened theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Vincent Mac</string>
<key>name</key>
<string>enlightened</string>
<key>settings</key>
<array>
@vincentmac
vincentmac / ex-largest-day.js
Created August 2, 2012 23:15
js:riak mr example
{
"inputs":"goog",
"query":[
{"map":{
"language":"javascript",
"source":
"function(value, keyData, arg) {
var data = Riak.mapValuesJson(value)[0];
var month = value.key.split('-').slice(0,2).join('-');
var volume = data.Volume;
@vincentmac
vincentmac / Preferences.sublime-settings
Last active October 7, 2015 23:41
SublimeText 3 User Preferences
{
"draw_white_space": "all",
"draw_indent_guides": true,
"indent_guide_options": ["draw_normal", "draw_active"],
// "font_face": "Inconsolata",
// "font_size": 14,
"font_face": "DejaVu Sans Mono",
"font_size": 12,
"highlight_line": true,
"ignored_packages":
@vincentmac
vincentmac / bash:riak cluster start
Created August 27, 2012 19:12
bash:riak dev cluster start
#! bash
# cli for loop to start riak dev cluster
for i in {1..4}; do dev$i/bin/riak start; done
@vincentmac
vincentmac / models.user.js
Created August 29, 2012 18:33
Riak-js: User Model Test
// models.user.js
// User Model Tests
// Chai Assertion Library
var chai = require('chai')
, expect = chai.expect
, should = chai.should()
, User = require('../models/user');
chai.Assertion.includeStack = true; // defaults to false
@vincentmac
vincentmac / user.js
Created August 29, 2012 18:36
Riak-js: User Model
/*!
* user.js
* User Model using Riak as a datastore
*/
/**
* Model dependencies
*/
var db = require('riak-js').getClient({debug: true, port:8091, api: 'http'});
@vincentmac
vincentmac / rcluster
Created September 22, 2012 23:16
sh:riak dev cluster start|stop
#!/bin/sh
# Vincent Mac
# Simple start/stop script for launching Riak Cluster for local development or fast track
# After building your dev environment using `make devrel`, place this script in the `dev` folder
# Identify the script name
SCRIPT=`basename $0`
case "$1" in
start)