Skip to content

Instantly share code, notes, and snippets.

orc = require('./src/orc.coffee').orc
sequence1 = ->
orc.sequence(
->
setTimeout orc.waitFor(), 1000
->
console.log 'done with sequence 1'
)
@michaelavila
michaelavila / Gemfile
Last active August 29, 2015 13:57
Simple Unique Exercism Iterations Algorithm
source "https://rubygems.org"
gem 'similar_text'
import Cocoa
var name: NSString?
func bang_and_greet(name:NSString!) {
println("hello \(name)")
}
func dont_bang_and_greet(name:NSString) {
println("hello \(name)")
[alias]
remind = !echo "Reminders: " && git reminders | cut -d ' ' -f2 | xargs -L1 git reminders show
reminders = notes --ref=reminders
@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 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/{}
# 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]
@michaelavila
michaelavila / .travis.yml
Last active August 29, 2015 14:09
Working Travis-CI config for newly created Swift (iOS) projects
language: objective-c
osx_image: xcode61
script:
- xctool test -project Project.xcodeproj -scheme Project -sdk iphonesimulator
@michaelavila
michaelavila / dot.sh
Created November 18, 2014 21:31
Simple dotfiles management.
#!/usr/bin/env sh
DOTVERSION=0.0.1
function dot() {
(( $# )) || (echo "No arguments provided." && dot-usage)
# check for version, and help
for arg in "$@"
do
case $arg in
@michaelavila
michaelavila / .java
Last active August 29, 2015 14:26
java 8: func <$> arg1 <*> arg2 <*> arg3
package com.michaelavila;
import java.util.Optional;
import java.util.function.Function;
/**
* Created by michaelavila on 7/30/15.
*/
public class FunctionalExamples {
public static void main(String[] args) {