Skip to content

Instantly share code, notes, and snippets.

# usage: find-dotfiles [directory]
function find-dotfiles() {
# I store my dotfiles in git, therefore I want to ignore
# the following files, and everyone wants to ignore "."
default_excludes=("." "*.git" "*.gitmodules")
exclude=$(printf " -not -iwholename '%s'" ${default_excludes[*]}) # map to -not -iwholename $FILE
eval "find ${1-$PWD} -name '.*' $exclude -maxdepth 1 | xargs -L1 -I {} basename {}"
}
# usage: link-dotfiles [from] [to]
alias dotfiles='find . -not -iwholename "." -not -iwholename "*.git" -not -iwholename "*.gitmodules" -name ".*" -maxdepth 1'
cd ~/work/me/dotfiles
dotfiles | cut -c 3- | xargs -L1 -I {} ln -s $PWD/{} $HOME/{}
dotfiles | cut -c 3- | xargs -L1 -I {} rm $HOME/{}
@michaelavila
michaelavila / .gitconfig
Created November 4, 2014 21:19
Selecta Pres Resources
[alias]
find-branch = !git branch | cut -c 3- | selecta | xargs git checkout
[alias]
remind = !echo "Reminders: " && git reminders | cut -d ' ' -f2 | xargs -L1 git reminders show
reminders = notes --ref=reminders
import Cocoa
var name: NSString?
func bang_and_greet(name:NSString!) {
println("hello \(name)")
}
func dont_bang_and_greet(name:NSString) {
println("hello \(name)")
@michaelavila
michaelavila / Gemfile
Last active August 29, 2015 13:57
Simple Unique Exercism Iterations Algorithm
source "https://rubygems.org"
gem 'similar_text'
orc = require('./src/orc.coffee').orc
sequence1 = ->
orc.sequence(
->
setTimeout orc.waitFor(), 1000
->
console.log 'done with sequence 1'
)
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.15 (Darwin)
mQENBFKBokYBCACotuKzQUS+JEkL1UQBh9Vlqqbev2mfIJOcReMXWEIv+k5ekiqu
1JvQKN3C4CeAfoJ6OBAJ8Ut8VczWUhYdXN9qert1A2xaL7LunVLNJBrdCrvOC3L7
vRD8T3WqZQMrQhvYKqL7OGgUkBss4RFEJGKWK4Lhpb3TTxa+HIvdjJGuoGoRAMtJ
y7ad5mHjT93kodq4dRio1tYh1M1Fcp5Mf6ZsEJbtx8A+rX0BFhk7mSkeHVh7pDLM
3mf5X7980jFVft/L6F0AWQEEgg5xXbFdpx3tK6Q3XJPi0mwR+oHZYD6GGAjRZLoP
Z2sVGnNuO+60T8wt4313qGPrZDr9LLs44GBZABEBAAG0I01pY2hhZWwgQXZpbGEg
PG1lQG1pY2hhZWxhdmlsYS5jb20+iQE4BBMBAgAiBQJSgaJGAhsDBgsJCAcDAgYV
@michaelavila
michaelavila / nand2tetris.md
Last active December 27, 2015 15:19
Information for Nand2Tetris MeetUp

What is it?

A meetup of people planning to work through "The Elements of Computing System". The tl;dr is simple: we're building a computer from scratch. Well, almost anyway, we'll be building machines from Nand gates. This will all happen on hardware simulators. More information about the project can be found here: http://nand2tetris.org

What do I need to bring?

A computer. Any modern computer should do.

What do I need to know?

var events = require('events')
var emitter = new events.EventEmitter();
emitter.addListener('hello', sayHello);
function doSomething() {
emitter.emit('hello');
console.log('This should run last');
}