Skip to content

Instantly share code, notes, and snippets.

View bcomnes's full-sized avatar
👽

Bret Comnes bcomnes

👽
View GitHub Profile
@bcomnes
bcomnes / OS config
Last active March 28, 2016 18:17
mafintosh patterns
@mafintosh │ JSON_voorhees: i put in env.USERPROFILE + .conf.rc on win
function Life (seed) {
if (!(this instanceof Life)) {
return new Life(seed)
}
this.seed = seed
this.height = seed.length
this.width = seed[0].length
this.prevBoard = []
this.board = cloneArray(seed)
}
@bcomnes
bcomnes / gist:26a6c2a705ff0da40708
Created September 14, 2015 22:55
Super short modern ssh keys
$ ssh-keygen -t ed25519
http://ed25519.cr.yp.to/
{
"scripts": {
"build": "babel index.js --out-dir dist --source-map",
"prepublish": "npm run build",
"test": "standard index.js && npm run build && tap test/*.js"
}
}
clang: warning: no such sysroot directory: ''
clang: warning: no such sysroot directory: ''
creating ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'asan': 0,
'host_arch': 'x64',
@bcomnes
bcomnes / .bashrc
Last active July 5, 2016 20:05
Git ssh key encryption password provided via ssh_askpass that integrates with windows credential store
# based on script from here:
# https://help.github.com/articles/working-with-ssh-key-passphrases#platform-windows
# https://github.com/lukesampson/pshazz/blob/41f5c7b832acf862a12cf4630bbe88e6e12f6e6e/plugins/ssh.ps1
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
@bcomnes
bcomnes / requireCss.js
Last active October 12, 2015 18:15
Require the style folder exposed by package.json
var path = require('path')
function requireCss (module) {
var packagejson = module + '/package.json'
var pathName = path.dirname(require.resolve(packagejson))
var stylePath = require(packagejson).style
var style = path.join(pathName, stylePath)
return {
style: style,
path: path.dirname(style)
@bcomnes
bcomnes / node.service
Last active December 14, 2015 00:02
Example node systemd service
# Put in /etc/systemd/system or ~/.config/systemd/user/ if running with --user flag
[Unit]
Description=Example Node Systemd Service
[Service]
ExecStart=/usr/local/bin/node /home/project-folder/server.js
Restart=always
StandardOutput=syslog
SyslogIdentifier=logid
╭━━━┳━━━┳━━┳━━━╮
┃╭━╮┃╭━╮┣┫┣┻╮╭╮┃
┃┃╱┃┃┃╱╰╯┃┃╱┃┃┃┃
┃╰━╯┃┃╱╭╮┃┃╱┃┃┃┃
┃╭━╮┃╰━╯┣┫┣┳╯╰╯┃
╰╯╱╰┻━━━┻━━┻━━━╯
@bcomnes
bcomnes / ip_drop.sh
Created October 25, 2015 00:38
Shell script to block IPs thanks donpdonp
echo dropping $1
sudo iptables -I INPUT -s $1 -j DROP