Skip to content

Instantly share code, notes, and snippets.

Lucas Fais lucasfais

  • São Paulo, Brazil
Block or report user

Report or block lucasfais

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lucasfais
lucasfais / gist:1207002
Created Sep 9, 2011
Sublime Text 2 - Useful Shortcuts
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
@lucasfais
lucasfais / currentTrackLyrics.swift
Created Nov 27, 2015
Opens Musixmatch website searching for the current iTunes track
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}
}
@lucasfais
lucasfais / Vagrantfile
Last active Dec 25, 2015
Vagrantfile for Arch Linux. It's ok with vagrant 1.3.4.
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:419779
=begin
My configuration: ruby 1.8.7-p174, rails 2.3.5 and mongoid 1.9.0.
I need make a tree of nested categories like this:
Category 1
Category 11
Category 12
Category 121
Category 2
View gist:176300
SSHFS mount
1. http://code.google.com/p/macfuse/ (instalar MacFuse)
2. http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS (descompactar e copiar para /usr/local/bin/sshfs; dar permissao de execucao)
3. sshfs root@search_vm:/ /Users/lfais/work/search_vm/ -o allow_other,auto_cache,reconnect,volname=SEARCH_VM,defer_permissions
@lucasfais
lucasfais / gist:14754
Created Oct 4, 2008
Avisando o Rails da depenencia com factory_girl
View gist:14754
config.gem "thoughtbot-factory_girl", :lib => "factory_girl", :source => "http://gems.github.com"
View factories.rb
Factory.define :operation_one, :class => Operation do |o|
o.description 'Salario'
o.category 'Proventos'
o.value 5000
end
Factory.define :operation_two, :class => Operation do |o|
o.description 'Gasolina'
o.category 'Transporte'
o.value -200
You can’t perform that action at this time.