Skip to content

Instantly share code, notes, and snippets.

View ZackMattor's full-sized avatar

Zachary Mattor ZackMattor

View GitHub Profile
#!/usr/bin/ruby -w
# INSTALL (zsh)
# mkdir -p ~/Screenshots; defaults write com.apple.screencapture location ~/Screenshots
# echo 'alias share="~/share-last-screenshot.rb"' >> ~/.zprofile
filename = Dir.glob("#{ENV['HOME']}/Screenshots/*").max_by {|f| File.mtime(f)}
url = `curl -T '#{filename}' http://chunk.io 2> /dev/null`.chomp
@ZackMattor
ZackMattor / spread.js
Created April 30, 2016 19:37
Testing spread in node
console.log('Testing spread operator...');
var tests = {
spread(a, b, c, d, e, f) {
console.log(a);
console.log(b);
console.log(c);
console.log(d);
console.log(e);
console.log(f);
@ZackMattor
ZackMattor / nginx.conf
Created December 23, 2013 06:40
Unicorn, nginx, init.d
worker_processes 1;
user nobody nogroup; # for systems with a "nogroup"
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024; # increase if you have lots of clients
accept_mutex off; # "on" if nginx worker_processes > 1
http://emberjs.jsbin.com/ohaXiFo/5/edit
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active April 11, 2025 19:59
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
mkdir -p ~/.ssh
# generate new personal ed25519 ssh keys
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>"
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
@haywoood
haywoood / gist:4540930
Created January 15, 2013 18:45
Command to load postgres .dump file to local development db
turn this into a script
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U rhaywood -d flp_development latest.dump