Skip to content

Instantly share code, notes, and snippets.

View fibo's full-sized avatar
🎼
Working from everywhere

Gianluca Casati fibo

🎼
Working from everywhere
View GitHub Profile
@fibo
fibo / gist:1203756
Created September 8, 2011 16:00 — forked from osfameron/gist:1203752
Crivello Haskell
import Data.List
import Debug.Trace
-- primes = 2 : 3 : zipWith getPrime primes (tail primes)
checkZeros :: [Int] -> Bool
checkZeros ms = any isZero ms
where isZero 0 = True
isZero _ = False
calculateMods :: Int -> [Int] -> [Int]
@fibo
fibo / index.js
Last active September 30, 2015 21:39
requirebin sketch
// Code from http://g14n.info/algebra/#quick-start
// This is a 60 seconds tutorial to get your hands dirty with algebra.
/////////////////////////////////////////////////////////////////////
// First of all, import algebra package.
var algebra = require('algebra');
/// Scalars
@fibo
fibo / index.js
Last active October 16, 2015 18:49
requirebin sketch
// Backlink: http://g14n.info/dflow#requirebin
var dflow = require('dflow')
var funcs = {
createElement: document.createElement.bind(document),
appendChild: function (parent, child) { return parent.appendChild(child) },
bodyAppendChild: function (child) { return document.body.appendChild(child) },
createTextNode: document.createTextNode.bind(document)
},
graph = {
@fibo
fibo / express.coffee
Last active December 19, 2015 09:39
Have an express coffee
# [Gist](https://gist.github.com/fibo/5934269)
#
# Deps:
# npm install express --save-dev
# npm install nodemon -g
# npm install coffee-script -g
#
# Run it with `nodemon express.coffee`
express = require 'express'
@fibo
fibo / login.sql
Last active December 23, 2015 06:18
sqlplus user profile
-- [Gist](https://gist.github.com/fibo/6592631)
--
-- Put this login.sql file in your current dir, or any dir you add to the SQLPATH env var
-- Make SQL prompt show database name so I know where I am (thanks to Tom Kyte for this)
COLUMN global_name new_value gname
SET TERMOUT OFF
SELECT LOWER(USER) || '@' || global_name || '> ' AS global_name FROM global_name;
SET SQLPROMPT '&gname'
SET TERMOUT ON
@fibo
fibo / utf8.pl
Created November 27, 2013 17:20
#!/usr/bin/env perl
#
# Answer to http://mortoray.com/2013/11/27/the-string-type-is-broken/
#
use strict;
use warnings;
use utf8;
use v5.18;

Coding Guidelines

README Driven Development

From Tom Preston-Werner's article,

Write your Readme first.

Create a README.md in your repository root folder and write there all information

@fibo
fibo / Microservice-component-definition.md
Last active April 28, 2016 09:47
is a set of requirements that define a microservice component pluggable in an API gateway

Microservice component

is a set of requirements that define a microservice component pluggable in an API gateway

Definition

A Microservice component is a [microservice][microservices] that serves a [REST API][REST] behind an API Gateway. The API Gateway is, for instance, binded to domain api.example.org and it must serve resources over https. The chosen technology is [nginx][nginx] but can be any reverse proxy.

@fibo
fibo / oracle.t
Last active May 11, 2016 12:54
Test Oracle connection
# [Gist](https://gist.github.com/fibo/5901819)
#
## How to launch
# $ prove oracle.t
use strict;
use warnings;
use DBI;
use File::Spec;
use Test::More;