This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# [Gist](https://gist.github.com/fibo/6807322) | |
# | |
## Configuration | |
# | |
# Don' t forget to edit filename and query, see below. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- [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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Math::Prime::XS ':all'; | |
my $l = $ARGV[0]; | |
my @primes = primes($l); | |
my $p1 = $primes[-2]; | |
my $p2 = pop @primes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
NewerOlder