Skip to content

Instantly share code, notes, and snippets.

View flavioribeiro's full-sized avatar
:octocat:

Flavio Ribeiro flavioribeiro

:octocat:
View GitHub Profile
#encoding: utf-8
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from clickemgrupo import settings
import cgi
import simplejson as json
import oauth2 as oauth
from clickemgrupo.apps.user import models as user_models
from clickemgrupo.apps.shopping_cart import models as shoppingcart_models
#encoding: utf-8
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from clickemgrupo import settings
import cgi
import simplejson as json
import oauth2 as oauth
from clickemgrupo.apps.user import models as user_models
from clickemgrupo.apps.shopping_cart import models as shoppingcart_models
@flavioribeiro
flavioribeiro / gist:2564620
Created May 1, 2012 02:55
dailykata test
print "testing one two three"
{
"actives": [
{
"m3u8": "/msfc/Edge.m3u8",
"servers": [
"http://liveips.nasa.gov.edgesuite.net"
],
"bitrates": [],
"needs_index": false
}
<html>
<head>
<style>
#content {
margin: 0 auto;
text-align: center;
}
#controls * {
font-size: 2.5em;
@flavioribeiro
flavioribeiro / gist:3267348
Created August 5, 2012 22:09
dailykata first exercise
#!/usr/bin/perl -w
sub fibonacci {
my $n = $_[0];
if ($n <= 1) {
return $n;
}
else {
return fibonacci($n-1) + fibonacci($n-2);
@flavioribeiro
flavioribeiro / gist:3334526
Created August 12, 2012 21:16 — forked from jbochi/gist:3331737
Fibonnaci in C for dailykata.net
// just a small mod in @jbochi's solution
#include <stdio.h>;
int fib(int n) {
if (n < 2) {
return n;
} else {
return fib(n - 1) + fib(n - 2);
}
@flavioribeiro
flavioribeiro / gist:3335608
Created August 13, 2012 00:08
Bowling Game - Go dailykata.net
/*
more about this kata:
http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata
*/
@flavioribeiro
flavioribeiro / compose.py
Created October 4, 2012 14:59 — forked from jbochi/compose.py
function composition in python
class O():
def __repr__(self):
return "<" + ' *o* '.join(map(repr, self.funs)) + ">" if self.funs else "<composer>"
def __init__(self, funs=None):
self.funs = funs if funs else []
def __rmul__(self, other):
other_funs = other.funs if isinstance(other, O) else [other]
return O(other_funs + self.funs)