Skip to content

Instantly share code, notes, and snippets.

View beenhere4hours's full-sized avatar

Daniel Masi beenhere4hours

View GitHub Profile
@beenhere4hours
beenhere4hours / notes-setup-2nd-redis.md
Last active January 10, 2024 20:26 — forked from inecmc/notes.md
How to run multiple Redis instances on Ubuntu 16.04

Create the directory for the new instance

$ sudo install -o redis -g redis -d /var/lib/redis2

Create a new configuration file

$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
@beenhere4hours
beenhere4hours / source.control.process.md
Last active August 31, 2021 19:33
my source control process based roughly on git flow

Source Control Process

cloning

git clone git@github.com:<repo name>.git

branching

Assumes fresh repo and always branching from master branch

" git commit message config
autocmd FileType gitcommit set textwidth=72
autocmd FileType gitcommit set colorcolumn=73
" git populate commit template with variables
" https://vi.stackexchange.com/a/11900
function! s:expand_commit_template() abort
let branch = split(matchstr(system('git rev-parse --abbrev-ref HEAD'), '\p\+'), "-")
let context = {
[${TICKET_SYSTEM}-${TICKET_NUMBER}] Subject line
# body message goes below
@beenhere4hours
beenhere4hours / install-Adobe-Source-Code-Pro.sh
Last active January 31, 2017 00:12
download and setup adobe source code pro font on Ubuntu 16
[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype
sudo git clone https://github.com/adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp
sudo fc-cache -f -v
function Util() {
Util.guid = function() {
return this.s4() + this.s4() + '-' + this.s4() + '-' + this.s4() + '-' + this.s4() + '-' + this.s4() + this.s4() + this.s4();
}
Util.s4 = function() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
}
@beenhere4hours
beenhere4hours / appc-build.sh
Last active September 9, 2015 14:23
bash script to assist with building and exporting native modules for appcelerator
#!/bin/bash
SCRIPT=`basename ${BASH_SOURCE[0]}`
CODE="/Users/$USER/code"
exitWithMessageAndCode() {
echo "${1}"
exit ${2}
}
@beenhere4hours
beenhere4hours / string-utils.js
Last active August 29, 2015 14:19
Extending the String class with helpful functions for templating
/**
* Javascript implementation of String.format or printf
*
* example of usage
* 'vincenty lat1: {0} lon1: {1} lat2: {2} lon2: {3}'.format(lat1, lon1, lat2, lon2)
*
* outputs
* vincenty lat1: 40.689247 lon1: -74.044502 lat2: 40.7747222222 lon2: -73.8719444444
*
* http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format/4673436#comment46715555_4673436
@beenhere4hours
beenhere4hours / http-response-codes.txt
Created April 14, 2015 21:46
HTTP Response Codes
Informational Responses
100
Error Text: continue
Description: This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
HTTP 1.0 only
101
Error Text: switching protocol
@beenhere4hours
beenhere4hours / jsonRPCPeer.php
Last active January 31, 2017 00:10
PHP JSON RPC Peer
<?php namespace JSONRPC;
class jsonRPCClient {
/**
* Debug state
*
* @var boolean
*/
private $debug;