Skip to content

Instantly share code, notes, and snippets.

View brainrake's full-sized avatar
λ ék .

Márton Boros brainrake

λ ék .
  • Budapest, Hungary
View GitHub Profile
@brainrake
brainrake / buttons.js
Created January 12, 2017 22:08
model-view-update in js
<html>
<body>
<script src="https://gitcdn.xyz/repo/Matt-Esch/virtual-dom/master/dist/virtual-dom.js"></script>
<script>
var h = require('virtual-dom/h');
var diff = require('virtual-dom/diff');
var patch = require('virtual-dom/patch');
var createElement = require('virtual-dom/create-element');
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
-- give a name to an extensible record with fields common to all ducks
type Duck a = { name :: String
, color :: String | a }
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
-- give a name to an extensible record with fields common to all ducks
type Duck a = { name :: String
, color :: String | a }
import Html exposing (Html, div, text)
-- give a name to an extensible record with fields common to all ducks
type alias Duck a = { a | name : String
, color : String }
-- operation common to all ducks
mg = require 'mongoose'
Global = new mg.Schema
progress: String
RecipeUpload = new mg.Schema
lang: type: String, index: yes
filename: type: String, index: yes
contents: Buffer
import Color (..)
import Graphics.Collage (..)
import Graphics.Element (..)
import Time (fps, fpsWhen)
import Keyboard (isDown)
import Char (toCode)
import Signal (foldp,map2, (<~))
import Text(asText)
import List (map, (::))
@brainrake
brainrake / .xbindkeysrc
Last active August 29, 2015 14:10
tv install
"python2 switch.py 1"
1
"python2 switch.py 2"
2
"python2 switch.py 3"
3
"amixer set Master 5+"
@brainrake
brainrake / strandalone.ino
Created January 1, 2014 04:58
led strand test
#include <Wire.h>
#include "WiiChuck.h"
#include <Adafruit_NeoPixel.h>
#define PIN 0
//#define N 232
#define N 62
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
@brainrake
brainrake / strander.ino
Created January 1, 2014 04:58
led strand control with wii nunchuck
#include <Wire.h>
#include "WiiChuck.h"
#include <Adafruit_NeoPixel.h>
#define PIN 0
//#define N 232
#define N 62
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
#include <Adafruit_NeoPixel.h>
#define PIN 0
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)