View currentTrackLyrics.swift
#! /usr/bin/swift
import ScriptingBridge
import AppKit
@objc protocol iTunesTrack {
optional var artist: String {get}
optional var name: String {get}
optional var album: String {get}
}
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View Azkfile.js
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
crawler: {
// Dependent systems
depends: ["elasticsearch"],
// More images: http://images.azk.io
View gist:e920010308a254393f5a
# ssh aws instances by name tag
# jq required - http://stedolan.github.io/jq/
#
# Usage:
# $ aws-ssh <ssh_user_name> <instance_name>
#
function aws-ssh(){
ssh $1@$(aws ec2 describe-instances --filters "Name=tag-key,Values=Name" "Name=tag-value,Values=$2" --output json | jq -r .Reservations[0].Instances[0].PublicIpAddress)
}
View keybase.md

Keybase proof

I hereby claim:

  • I am lucasfais on github.
  • I am lucasfais (https://keybase.io/lucasfais) on keybase.
  • I have a public key whose fingerprint is 3B65 7DBB D1C2 BD25 E7FE 6807 DEC2 2EA0 6164 6E8A

To claim this, I am signing this object:

View Vagrantfile
# My helpers
#
def fwd_ports(config, ports)
ports = [ports] unless ports.respond_to?(:each)
ports.each do |port|
config.vm.network :forwarded_port, guest: port, host: port
end
end
View gitconfig
[user]
name = X
email = x@x.com
[color]
branch = auto
status = auto
diff = auto
[alias]
ci = commit
co = checkout
View fizz_buzz.exs
# Fizz Buzz Test
# http://c2.com/cgi/wiki?FizzBuzzTest
fizz_buzz = fn
(0, 0, _) -> "FizzBuzz"
(0, _, _) -> "Fizz"
(_, 0, _) -> "Buzz"
(_, _, x) -> x
end
View parallel_requests.exs
defmodule ParallelRequests do
def execute_requests(urls) do
:inets.start()
Enum.map urls, do_parallel_request(&1, self)
do_collect_responses(length(urls), 0)
end
defp do_parallel_request(url, parent_id) do
View gist:1207002

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt