Skip to content

Instantly share code, notes, and snippets.

View proudlygeek's full-sized avatar
🍕

Gianluca Bargelli proudlygeek

🍕
View GitHub Profile
@proudlygeek
proudlygeek / reinvoke.cljs
Created April 9, 2012 21:57 — forked from alandipert/reinvoke.cljs
It's sweet IFn is a protocol in ClojureScript
(extend-type js/RegExp
cljs.core.IFn
(-invoke ([this s] (re-matches this s))))
(#"foo.*" "foobar") ;=> "foobar"
(#"zoo.*" "foobar") ;=> nil
(filter #".*foo.*" ["foobar" "goobar" "foobaz"]) ;=> ("foobar" "foobaz")

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].

@proudlygeek
proudlygeek / update_acl.rb
Created March 12, 2012 09:21 — forked from shaneog/update_acl.rb
Capifony Task to Set ACLs on Symfony2 app/cache and app/logs directories as per http://symfony.com/doc/current/book/installation.html
# Change ACL on the app/logs and app/cache directories
after 'deploy', 'deploy:update_acl'
# This is a custom task to set the ACL on the app/logs and app/cache directories
namespace :deploy do
task :update_acl, :roles => :app do
shared_dirs = [
app_path + "/logs",
@proudlygeek
proudlygeek / toys.rb
Created February 18, 2012 14:05 — forked from lucapette/toys.rb
methods to create toys arrays and hashes (using modules)
module MonkeyIrb
def self.included(base)
# Monkey-patching Array
class << Array
def toy(n=10, &block)
block_given? ? Array.new(n, &block): Array.new(n) { |i| i + 1 }
end
end