Skip to content

Instantly share code, notes, and snippets.

View zachahn's full-sized avatar
🖥️
Probably programming

Zach Ahn zachahn

🖥️
Probably programming
View GitHub Profile

Keybase proof

I hereby claim:

  • I am zachahn on github.
  • I am zachahn (https://keybase.io/zachahn) on keybase.
  • I have a public key ASAPXIWZ3hD5qyYinKWUV05V_YCIp23AlyiZGfbc2Q0Y1Qo

To claim this, I am signing this object:

@zachahn
zachahn / SHIPIT
Last active August 29, 2015 14:16
SHIP IT
I'M GONNA SHIP IT!
@zachahn
zachahn / groups.rb
Created January 5, 2015 22:10
make random groups
if ARGV.length != 2
puts "usage: #{$0} <comma separated list> <maximum group size>"
exit
end
if ARGV[1].to_i < 1
puts "preferred group size must be greater than 0"
exit
end
@zachahn
zachahn / serialized_attr_accessor.rb
Created October 31, 2014 07:47
attr_accessor for serialized hash columns in ActiveRecord
module SerializedAttrAccessor
extend ActiveSupport::Concern
module ClassMethods
def serialized_attr_accessor column, *pseudocols
pseudocols.each do |pseudocol|
reader = pseudocol
writer = "#{pseudocol}=".to_sym
define_method(reader) do
# Add to Mac Keychain
ssh-add -K ~/.ssh/id_rsa
@zachahn
zachahn / backup.sh
Created August 10, 2014 06:18
full server backups
tar -zcpf /backup/fb-`date +%s`.tgz --directory=/ --exclude=proc --exclude=sys --exclude=dev --exclude=backup --exclude=tmp --exclude=var/run --exclude=var/lock .
@zachahn
zachahn / tmux
Created July 29, 2014 16:40
install tmux
1. `brew install tmux`
2. https://github.com/norio-nomura/EasySIMBL
3. https://bitheap.org/mouseterm/
@zachahn
zachahn / post-receive
Created May 14, 2014 14:54
deploy hook
#!/bin/sh
GIT_WORK_TREE=/absolute/path/to/deploy/directory git checkout -f
cd /Library/WebServer/
open .
# right click `Documents` -> `Get Info`
# unlock (bottom right)
# plus button [+] -> choose yourself -> select
sudo chmod +a "user:_www allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity" Documents
# you can alias `ls` to `ls -e` to see the permissions whenever you `ls`
vim /private/etc/apache2/httpd.conf
# uncomment the PHP line
sudo apachectl start
# macports mamp setup
- https://trac.macports.org/wiki/howto/MAMP
## pkgs
sudo port install apache2
sudo port install mariadb-server
sudo port install php54
sudo port install php54-gd