Skip to content

Instantly share code, notes, and snippets.

View samholmes's full-sized avatar

Sam Holmes samholmes

View GitHub Profile
@creationix
creationix / howtonode.conf
Created March 20, 2012 17:52
howtonode.org upstart script
description "Run node server"
env PATH=/home/tim/nvm/v0.6.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
respawn
start on runlevel [23]
script
cd /home/tim
exec node server.js > access.log 2>> error.log
@gkatsev
gkatsev / extend.js
Created July 23, 2012 04:50
A simple and naive extend implementation
function extend(obj, extend){
var p;
for (p in extend) {
obj[p] = extend[p];
}
return obj;
}
var obj = {
a : 1
@nlf
nlf / gist:4049524
Created November 10, 2012 02:06
simple multi-cert bouncy
var servers = {
'example.com': { port: 5000, key: fs.readFileSync('/path/to/key', 'utf8'), cert: fs.readFileSync('/path/to/cert', 'utf8') },
'example.net': { port: 6000, key: fs.readFileSync('/path/to/key2', 'utf8'), cert: fs.readFileSync('/path/to/cert2', 'utf8') }
}
function sni_check(servername) {
if (~Object.keys(servers).indexOf(servername)) {
return crypto.createCredentials(servers[servername]).context;
}
}
@samholmes
samholmes / .bash_profile
Last active March 8, 2019 20:42
Lightning Simple PS1
# Red Colored
PS1="\e[0;31m\W ϟ\] \e[m"
# Red Background
PS1="\[\033[41m\033[30m\] \u \[\033[49m\033[31m \033[41m\033[30m\] \w \[\033[49m\033[31m\] ϟ \[$(tput sgr0)\]"
# Blue Background
PS1="\[\033[46m\033[30m\] \u \[\033[49m\033[36m \033[46m\033[30m\] \w \[\033[49m\033[36m\] ϟ \[$(tput sgr0)\]"
@gadiener
gadiener / generate-bitcoin-keys.sh
Last active June 5, 2024 01:15
OpenSSL commands to create a Bitcoin private/public keys from a ECDSA keypair
#!/bin/sh
PRIVATE_KEY="ECDSA"
PUBLIC_KEY="ECDSA.pub"
BITCOIN_PRIVATE_KEY="bitcoin"
BITCOIN_PUBLIC_KEY="bitcoin.pub"
echo "Generating private key"
openssl ecparam -genkey -name secp256k1 -rand /dev/random -out $PRIVATE_KEY
@samholmes
samholmes / mkprod.sh
Created March 2, 2018 21:43
Shell script to make git deployable production environments
#!/bin/sh
NAME=$1
DIR=$PWD
if [ ! -d "$DIR/$NAME" ]; then
mkdir "$NAME"
fi
if [ ! -d "$DIR/repos" ]; then
@samholmes
samholmes / Material.terminal
Last active October 28, 2020 15:30
Material Theme for Terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGjCwwTVSRudWxs0w0ODxARElVO
U1JHQlxOU0NvbG9yU3BhY2VWJGNsYXNzTxAcMC41MDk4MDM5MjE2IDAuNjY2NjY2NjY2
NyAxABACgALSFBUWF1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiFhhYTlNPYmpl
@samholmes
samholmes / keybindings.json
Last active October 28, 2020 16:19
VS Code User Keybindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+shift+\\",
"command": "editor.action.selectToBracket"
},
{
"key": "ctrl+\\",
"command": "editor.action.jumpToBracket",
"when": "editorTextFocus"
@samholmes
samholmes / .prettierrc
Created February 25, 2020 16:06
Preferred Standard Formatting
{
"semi": false,
"useTabs": true,
"singleQuote": true,
"trailingComma": "es5"
}
@samholmes
samholmes / settings.json
Last active February 25, 2020 19:25
VS Code User Settings
// Place your settings in this file to overwrite the default settings
{
"terminal.integrated.shellArgs.osx": [
"-l"
],
"workbench.iconTheme": "eq-material-theme-icons",
"workbench.colorTheme": "Material Theme High Contrast",
"editor.minimap.enabled": true,
"editor.rulers": [
75,