Skip to content

Instantly share code, notes, and snippets.

@alganet
alganet / developerquiz.php
Created August 8, 2011 20:28
Full script for the Google Developer Day Quiz (http://developerquiz.appspot.com) in 39 lines
<?php //Run as command line. Input file as first argument.
const G_FOO = 'aeiou'; //Googlon special letters
const G_INV = 'z'; //Preposition invalidator
const G_PREP = 3; //Preposition size
const G_VERB = 8; //Verb size
const G_ORDER = 'qnbczxjtklmvhrwfsdgp'; //Letter ordering
const G_NUM_MOD = 4; //Pretty number divisor
const G_NUM_MAX = 526593; //Pretty number minimum
$textB = explode(' ', file_get_contents($argv[1]));
@turicas
turicas / Makefile
Created December 3, 2011 23:22
Create slugs and abbreviate names using Python
test:
clear
nosetests --with-coverage --cover-package name_utils test_name_utils.py
clean:
find -regex '.*\.pyc' -exec rm {} \;
find -regex '.*~' -exec rm {} \;
.PHONY: test clean
@ihercowitz
ihercowitz / xmlbuilder.py
Created July 6, 2012 19:37
Building a XML Tree as Easy as ABC in Python
'''
****************************************************************************************
Building a XML Tree as Easy as ABC in Python
This implementation requires lxml
Sample:
print etree.tostring(xmlbuilder("main", unique=True,
produtos=dict(produto=dict(codigo="UFC153",
descricao="Cueca Velha",
@netojoaobatista
netojoaobatista / Array.range.js
Created August 2, 2012 17:29
ECMAScript 5 implementation of Python's range function
/**
* ECMAScript 5 implementation of Python's range function.
* @see {@link http://docs.python.org/release/1.5.1p1/tut/range.html}
* @param {Number} start
* @param {Number} end
* @param {Number} step
* @param {Boolean} includeEndpoint
* @return {Array}
*/
Object.defineProperty(Array, "range", {
@netojoaobatista
netojoaobatista / sample.php
Created August 8, 2012 15:00
Slug function
<?php
echo slug('João Batista Neto'); //joao-batista-neto
@ihercowitz
ihercowitz / aliciabooklet.rkt
Created November 1, 2012 12:40
Gerador de um livreto para o aniversario da alicia
#lang racket
(require slideshow)
(set-page-numbers-visible! #f)
(define (build-booklet images)
(unless (null? images)
(let ([page-left (car images)]
[page-right (cadr images)]
)
@andrewalker
andrewalker / Briefing Hackaton.pod
Last active December 13, 2015 17:28
Briefing Hackaton

Hackaton Business::CPI

O que é?

Business::CPI (Common Payment Interface) é um módulo em Perl que define uma interface padrão para comunicação entre programas feitos em Perl e intermediários financeiros (que chamamos no CPI de gateways).