Skip to content

Instantly share code, notes, and snippets.

View dariocravero's full-sized avatar

Darío Javier Cravero dariocravero

View GitHub Profile
#!/usr/bin/env rackup
# encoding: utf-8
# This file can be used to start Padrino,
# just execute it from the command line.
require File.expand_path("../config/boot.rb", __FILE__)
require File.join(PADRINO_ROOT, "app/sockets.rb")
map "/sockets" do
(function(){var s="script",n='\n',d=document,b=d.getElementsByTagName(s);b=b[b.length-1].innerHTML.split(n); d.write('<'+s+' type="text/coffeescript">'+b.slice(1,b.length-2).join(n)+'</'+s+'>');})()
@dariocravero
dariocravero / LICENSE
Created January 5, 2012 16:56
Schedule commands using "at" from ruby.
# Copyright (c) 2012 - Darío Javier Cravero
#
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the
# Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@dariocravero
dariocravero / if_lambda
Created January 12, 2012 20:01
if_lambda support for declarative authorization
module Authorization
module Reader
class AuthorizationRulesReader
def if_lambda (lambda_fn)
raise DSLError, "if_lambda only in has_permission blocks" if @current_rule.nil?
@current_rule.append_attribute AttributeLambda.new(lambda_fn)
end
end
end
upstream myapp {
server unix:///myapp/tmp/puma.sock;
}
server {
listen 80;
server_name myapp.com;
# ~2 seconds is often enough for most folks to parse HTML/CSS and
# retrieve needed images/icons/frames, connections are cheap in
<iframe src="test" />
<iframe src="test" />
@dariocravero
dariocravero / Gemfile
Created September 5, 2012 18:48
Minimal sinatra app with puma's config.
source "https://rubygems.org"
gem 'puma'
gem 'sinatra'
@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@dariocravero
dariocravero / index.html
Created December 2, 2012 20:45
A CodePen by Darío Javier Cravero.
<div class=hover-me>HOVER THIS</div>
<div class=helper></div>