Skip to content

Instantly share code, notes, and snippets.

View foca's full-sized avatar
👋
Looking for work!

Nicolás Sanguinetti foca

👋
Looking for work!
View GitHub Profile
~ > heroku addons:add gmail_smtp user=<username> password=<password> --app extension-agents-build
Adding gmail_smtp to extension-agents-build...Done.
Adding user=<username> to extension-agents-build...FAILED
! no addon by that name
Adding password=<password> to extension-agents-build...FAILED
! no addon by that name
<%= foo(@object).cuack %>
<% foo(@objects).each do |o| %>
<%# you get the idea %>
<% end %>
require "mustache"
ActiveSupport::Dependencies.load_paths << Rails.root.join("app", "views")
class Mustache::Rails < Mustache
include ActionController::UrlWriter
include ActionView::Helpers
attr_accessor :request, :response, :params, :controller
Processing DashboardsController#show (for 127.0.0.1 at 2009-10-09 00:08:53) [GET]
Parameters: {"action"=>"show", "controller"=>"dashboards"}
User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."id" = 1) LIMIT 1
------> subdomain:
------> and for foobar: http://foobar.hephaestus.local/dashboard
Rendering dashboards/show
VIEW ------> subdomain:
VIEW ------> and for foobar: /dashboard
Completed in 111ms (View: 99, DB: 0) | 200 OK [http://hephaestus.local/]
@foca
foca / .gitconfig
Created October 10, 2009 23:15
open a vim buffer for each unmerged file in git
[alias]
unmerged = !vim -o $(git-unmerged-files)
@foca
foca / gist:215277
Created October 21, 2009 17:14
Flights for my RubyConf/Atlanta trip
MVD Nov 6th 18:45 ✈ 20:20 SCL
SCL 22:25 ✈ Nov 7th 05:10 MIA
MIA Nov 7th 09:30 ✈ 11:25 ATL
ATL Nov 14th 16:35 ✈ 19:05 SFO
SFO Nov 23rd 08:00 ✈ 09:35 LAX
LAX 12:00 ✈ Nov 24th 06:15 SCL
SCL Nov 24th 07:35 ✈ 10:50 MVD
@foca
foca / _transcript
Created November 2, 2009 22:56
Get formatted Adium chat transcripts into STDOUT
#!/usr/bin/env ruby
# Save this somewhere, chmod 755 it, then add
# complete -C path/to/this/script -o default transcript
# to your ~/.bashrc
exit 0 unless /^transcript\b/ =~ ENV["COMP_LINE"]
TRANSCRIPTS_DIR = File.expand_path("~/Library/Application\ Support/Adium\ 2.0/Users/Default/Logs")
@foca
foca / gist:238179
Created November 18, 2009 19:43 — forked from cschneid/gist:238124
### Make history behave itself
export HISTCONTROL=ignoredups # don't put duplicate lines in history
shopt -s histappend # make Bash append rather than overwrite history on disk
shopt -s cdspell # Help me get places
# write previous line to disk when prompt is displayed
export PROMPT_COMMAND='history -a'
export HISTFILESIZE=100000000
export HISTSIZE=10000000
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"
>> fibs = Enumerator.new { |y| a, b = 0, 1; loop { y.yield a; b, a = a, a+b } }
>> fibs.first(10)
=> [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
>> fibs.take_while {|i| i < 60 }
=> [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]