Skip to content

Instantly share code, notes, and snippets.

View enricostano's full-sized avatar

Enrico Stano enricostano

View GitHub Profile
def author(target)
case target
when User
do_this_to(target)
when Person
do_that_to(target)
else
raise ArgumentError
end
end
<tr>
<td class="cella_maquetacio_mitjana">
<table class="taula_maquetacio" summary="contenidos específicos" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="cella_maquetacio_estreta"><img src="imatges/fotos/colen.jpg" alt="Maite Colen" width="86" height="98"></td>
<td class="cella_maquetacio_estreta"rowspan="2"><img src="estils_ub/css_img/espai.gif" alt="imagen de maquetaci&oacute;n" width="12" height="1"></td>
<td class="cella_maquetacio_ampla"><h1 class="titol_text1">Maite Col&egrave;n Riau</h1>
<span class="titol_taula_dades">Coordinaci&oacute; de l'&agrave;mbit de recerca: Formaci&oacute; Permanent del Professorat i Innovaci&oacute; Pedag&ograve;gica.</span><br>
<img src="estils_ub/css_img/marcador_cercle3.gif" alt="marcador" height="16" width="10"> <a href="http://www.ub.edu/fodip/membres/colen_cat2.htm" class="text_base_enll"> Curr&iacute;culum <br>
<img src="imatges/
{
"name": "katuma-web",
"version": "0.0.1",
"homepage": "https://github.com/coopdevs/katuma-web",
"description": "Single page frontend application for Katuma API",
"main": "index.html",
"license": "AGPL",
"ignore": [
"**/.*",
"node_modules",
'use strict';
var $ = require('jquery')
, Backbone = require('backbone')
, Marionette = require('backbone.marionette')
, app = new Marionette.Application();
Backbone.$ = $;
app.start();
@enricostano
enricostano / builds_3500419
Last active August 29, 2015 14:01
feature/api3 - Addressed comments bravo
[Travis CI] Specs benchmark:
Models 00:17:53
Enterprise Models 00:01:12
Syntax 00:00:47
Production config 00:00:54
Enterprise config 00:02:26
Customizations 00:00:43
Jade precompile 00:00:54
Helpers 00:01:24
JS Unit 00:00:23
module Alfa
def self.included(base)
puts "#{self} included in #{base}"
unless base.const_defined?(:PAPPA)
base.const_set :PAPPA, [:a, :b]
end
end
def self.extended(base)
puts "#{self} extended in #{base}"
'use strict';
require("../../lib/bootstrap-3.1.1-dist/css/bootstrap.css");
require("../styles/main.css");
require("imports?jQuery=jquery!../../lib/bootstrap-3.1.1-dist/js/bootstrap.js");
var Backbone = require("backbone")
, Marionette = require("backbone.marionette")
, headerLayoutTemplate = require("../templates/header.handlebars")
, Katuma = new Marionette.Application({});
@enricostano
enricostano / foo_bar.rb
Created August 22, 2014 13:03
Ruby class variables
class FooBar
class << self
attr_accessor :variabile
def hola
p variabile
end
SELECT users.id FROM users WHERE users.id IN (SELECT m2.user_id FROM memberships AS m1 INNER JOIN memberships AS m2 ON (m1.user_id = 3 AND m2.group_id = m1.group_id));
SELECT users.id FROM users INNER JOIN memberships AS m1 ON (users.id = m1.user_id) INNER JOIN memberships AS m2 ON (m1.group_id = m2.group_id) WHERE m2.user_id = 3;
@enricostano
enricostano / lazyness.rb
Last active August 29, 2015 14:14
lazy iterator
arr = [1, 2, 3, 4, 5, 6, 7, 8]
[
[1, 2, 3, 4, 5],
[2, 3, 4, 5, 6],
[3, 4, 5, 6, 7],
[4, 5, 6, 7, 8],
[5, 6, 7, 8],
[6, 7, 8],
[7, 8],