Skip to content

Instantly share code, notes, and snippets.

View ignacioiglesias's full-sized avatar

ignacioiglesias ignacioiglesias

View GitHub Profile
@ignacioiglesias
ignacioiglesias / gist:2844244
Created May 31, 2012 15:40
My (very) liberal interpretation of JavaScript Module Pattern: In-Depth by Ben Cherry
// This is my (very) liberal interpretation of
// JavaScript Module Pattern: In-Depth by Ben Cherry
// http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
"use strict";
var api = (function(a) {
// I will use `a` as the API, so let's say I want to add some stuff,
// for instance, a logging module.
function privateDebugMethod(message) {
<!--
Author: @fat
Translated by: @ignacioiglesias with lots of help from @rtohme.
-->
<p>Ofrecí este pequeño consejo en twitter.</p>
<blockquote class="twitter-quote">
<p>Dejen la escuela o estudien Inglés. Así es como triunfan en
javascript</p>
— ♒∆✝ (@fat)
FreeMarker template error!
Error on line 1, column 1 in DEVELOPMENT/configuration_files/ftl/pageComponents/header.ftl
siteHelper.site.navigationHeader is undefined.
It cannot be assigned to global
The problematic instruction:
----------
==> assignment: global=siteHelper.site.navigationHeader [on line 1, column 1 in DEVELOPMENT/configuration_files/ftl/pageComponents/header.ftl]
in include "../pageComponents/header.ftl" [on line 121, column 25 in DEVELOPMENT/configuration_files/ftl/decorators/nes.ftd]
module Main where
fizz :: Integer -> String
fizz x
| x `mod` 15 == 0 = "FizzBuzz"
| x `mod` 5 == 0 = "Buzz"
| x `mod` 3 == 0 = "Fizz"
| otherwise = show x
main =
print (map fizz [1..100])
@ignacioiglesias
ignacioiglesias / 1.1.hs
Created September 17, 2012 16:24
Find the last element of a list
module Main where
myLength :: [x] -> Int
myLength x =
foldr (\x y -> y + 1) 0 x
myLast :: [x] -> x
myLast x =
x !! ((myLength x) - 1)
main =
var addScore = function(r) { return r.score = Math.random(), r }
@ignacioiglesias
ignacioiglesias / subway.js
Created October 2, 2012 22:53
Shrink text until it fits
// It's using Mootools to get/set the font-size. You shouldn't
// really need that, I'll change it later.
function shrink() {
var wrapper = $('wrapper'),
text = $('text'),
minimumFontSize = 11,
fontSize;
while(text.offsetWidth > wrapper.offsetWidth) {
@ignacioiglesias
ignacioiglesias / joystick.js
Created December 10, 2012 23:34
PS3 joystick buttons
var buttons = {
buttons: {
1 : 'L2',
2 : 'R2',
4 : 'L1',
8 : 'R1',
16 : '▲',
32 : '●',
64 : '■',
128 : '×'
And yet, and yet… Denying temporal succession, denying the self,
denying the astronomical universe, are apparent desperations and
secret consolations. Our destiny is not frightful by being unreal;
it is frightful because it is irreversible and iron-clad. Time is
the substance I am made of. Time is a river which sweeps me along,
but I am the river; it is a tiger which destroys me, but I am the tiger;
it is a fire which consumes me, but I am the fire.
The world, unfortunately, is real; I, unfortunately, am Borges.
— Borges - A New Refutation of Time (1946)
The fate of a writer is strange. He begins his career by being a baroque writer,
pompously baroque, and after many years, he might attain if the stars are favorable,
not simplicity, which is nothing, but rather a modest and secret complexity.
—Jorge Luis Borges, “Prologue,” The Self and The Other (1964)