Install (copy & paste):
curl -sL https://raw.github.com/gist/1708408/travis.rb > ~/bin/travis-ci \
&& chmod +x ~/bin/travis-ci
gem install hub | tail -2
ruby -e 'require "json"' 2>/dev/null || gem install json
Gemfile.lock merge=bundleinstall | |
db/schema.rb merge=railsschema |
~/code/rails/fat_free_crm [cloudfuji±|1.9.3p194]$ tane event customer created "{:email => 'cordies@gmail.com'}" | |
{"category"=>"customer", "event"=>"created", "data"=>{:email=>"cordies@gmail.com"}} | |
/home/masha/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!': 404 Resource Not Found (RestClient::ResourceNotFound) | |
from /home/masha/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' | |
from /home/masha/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit' | |
from /home/masha/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:745:in `start' | |
from /home/masha/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' | |
from /home/masha/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' | |
from /home/masha/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' | |
from |
Failure/Error: Unable to find matching line from backtrace | |
Timeout::Error: | |
Timeout::Error | |
# /home/ndbroadbent/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill' | |
# /home/ndbroadbent/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill' | |
# /home/ndbroadbent/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil' | |
# /home/ndbroadbent/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/protocol.rb:132:in `readline' | |
# /home/ndbroadbent/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line' | |
# /home/ndbroadbent/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:2551:in `read_new' | |
# /home/ndbroadbent/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request' |
module StaticHelpers | |
def action_for_template(template) | |
File.basename(template).sub(/\.html\.haml$/, '') | |
end | |
end | |
namespace :static do | |
desc "Precompile static pages at public/*.html" | |
task :precompile do | |
include StaticHelpers |
This was one of the winners of the recent International Obfuscated C Code Contest: http://www.ioccc.org/2012/tromp/hint.html | |
(code at http://www.ioccc.org/2012/tromp/tromp.c) | |
It's a [Binary Lambda Calculus](http://en.wikipedia.org/wiki/Binary_lambda_calculus) implementation, and it's absolutely incredible. I'm no computer scientist, but he wrote a program that can run an implementation of itself in only 29 bytes. | |
One of the example lambda calculus programs was: | |
\a a ((\b b b) (\b \c \d \e d (b b) (\f f c e))) (\b \c c) | |
... which is assembled into the following BLC code: |
#!/usr/bin/env ruby | |
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | |
APP_PATH = File.expand_path('../../config/application', __FILE__) | |
require File.expand_path('../../config/boot', __FILE__) | |
# Add --editor option to open generated files in editor | |
# ----------------------------------------------------- | |
module Rails | |
module Generators |
# Patch from https://github.com/rails/rails/pull/8862 | |
module ActionDispatch | |
Request.class_eval do | |
# Remove nils from the params hash | |
def deep_munge(hash) | |
hash.each do |k, v| | |
case v | |
when Array |
module Sq | |
class Template < Sequel::Model | |
one_to_many :fields | |
def mapped_template_ids | |
FieldMapping.as(:m). | |
join(Field.named(:f), id: :field_id, template_id: id). | |
join(Field.named(:mf), id: :m__mapped_field_id). | |
distinct.select_map(:mf__template_id) | |
end |
/* | |
* Add hook for jQuery.fn.on function, to manualy call window.Airbrake.captureException() method | |
* for every exception occurred. | |
* | |
* Let function 'f' be binded as an event handler: | |
* | |
* $(window).on 'click', f | |
* | |
* If an exception is occurred inside f's body, it will be catched here | |
* and forwarded to captureException method. |