Skip to content

Instantly share code, notes, and snippets.

View nponeccop's full-sized avatar

nponeccop

  • Barcelona, Spain
  • 00:30 (UTC +03:00)
View GitHub Profile
@nponeccop
nponeccop / bool_ind.lean
Last active March 17, 2016 16:24
Dependent induction principle for Church encoded booleans
namespace foo
definition bool := ∀ a : Type, a → a → a
definition tt : bool := λ (a : Type) (c d : a), c
definition ff : bool := λ (a : Type) (c d : a), d
definition bor (a b : bool) : bool := a bool tt b
definition boolProp := ∀ a : Prop, a → a → a
definition ind_on_T := ∀ P : bool → Prop, ∀ a : bool, P tt → P ff → P a
@nponeccop
nponeccop / Bitcoinity.ipynb
Created March 21, 2016 22:02
Monthly transaction count in log scale
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nponeccop
nponeccop / Main.hs
Created April 21, 2016 01:26
swizard task through Makefile generation
{-# LANGUAGE TypeFamilies, DeriveFunctor, OverloadedStrings, DeriveFoldable, FlexibleContexts #-}
module Main (main) where
import Prelude hiding (Foldable)
import qualified Prelude as P (Foldable)
import Data.Functor.Foldable
import Data.Foldable (toList)
import Language.Sexp
import Data.Maybe
data Op = Plus | Star | Minus deriving Show
@nponeccop
nponeccop / main.js
Last active April 21, 2016 03:19
swizard task in Node
var parse = require('sexpr-plus').parse
var Q = require('q')
var ops = {
'+' : (a, b) => a + b
, '-' : (a, b) => a - b
, '*' : (a, b) => a * b
}
function eval(p)
@nponeccop
nponeccop / bench.ipynb
Last active May 10, 2016 05:09
Abraxas #18 bench 1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nponeccop
nponeccop / hoopl-boilerplate.hs
Created June 28, 2015 18:34
A minimal HOOPL example
{-# LANGUAGE GADTs, NoMonomorphismRestriction, StandaloneDeriving, Rank2Types #-}
import Compiler.Hoopl
import Prelude hiding ((<*>))
data Node e x where
Entry :: Label -> Node C O
Exit :: [Label] -> Node O C
instance NonLocal Node where
@nponeccop
nponeccop / README.md
Last active June 11, 2016 22:43
60 FPS on iPhone

The code uses a slightly modified version of d3-axis component.

@nponeccop
nponeccop / README.md
Created June 15, 2016 23:49
24 FPS on sluggish LG L90 Duos

Lightning fast SVG chart

3x improvement vs previous version: 24 vs 8 vps on LG L90 Duos

High-end phones should all give 60 fps now

10 charts of 1070 points each

The axes are still the bottleneck, so I reduced tick count

@nponeccop
nponeccop / .block
Last active June 30, 2016 19:56 — forked from mbostock/.block
Pan & Zoom Axes
license: gpl-3.0