Since there is not much documentation on this yet, here are some notes:
OS/X HINT: use absolute filenames for input, otherwise the project file will be found but not the referenced files
Fileformat:
| #!/bin/bash | |
| # Nice mappings for FL Studio 12 and my M-Audio Axiom air 32 mini | |
| # aseqdump -l | |
| # aseqdump -p "Axiom A.I.R. Mini32" | |
| # sudo apt install xdotool | |
| aseqdump -p "Axiom A.I.R. Mini32" | \ | |
| while IFS=" ," read src ev1 ev2 ch label1 data1 label2 data2 rest; do | |
| #echo "$srsc $ev1 $ev2 $ch $label1 $data1 $label2 $data2 $rest" | |
| case "$ev1 $ev2 $data1 $data2" in | |
| "Control change 17 127" ) xdotool key space ;; |
| // 1. Open chrome://settings/passwords | |
| // 2. Open chrome developer tools (using F12 or Ctrl+Shift+i) | |
| // 3. Run the following code in the console tab | |
| // 4. Copy output in a text file and save it somewhere safe! | |
| function asyncForEach(array, done, iterator) { | |
| var i = 0; | |
| next(); | |
| function next(err) { | |
| if (err) { |
| var p = new Promise( function(resolve,reject){ | |
| resolve(374); | |
| }); | |
| p.then(function fulfilled(message){ | |
| foo.bar(); | |
| console.log(message); // never reached | |
| }, | |
| function rejected(err){ | |
| // never reached |
| "Vundle Setup | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| Plugin 'christoomey/vim-tmux-navigator' | |
| call vundle#end() | |
| filetype plugin indent on | |
| set autoread | |
| """"""""""""""""""""" |
In a recent discussion I had with a friend about Haskell and Scala, they brought up the fact that they sometimes miss Scala's partial functions. In Scala, these are a trait of their own somewhat different from what Haskellers usually understand by "partial function". In particular, you can check if a value is in the domain of the partial function before applying it to the function.
Interestingly enough, partial functions are also supported in Haskell - they just happen to be hidden away in some more obscure parts of the base library. What follows is my attempt to make a module that brings this functionality out and makes it more accessible. Since this is meant to be a literate Haskell source, let's start with some preamble.
{-# LANGUAGE TypeOperators, NoImplicitPrelude, GeneralizedNewtypeDeriving #-}
module Data.Function.Partial where
import Prelude hiding (id, (.), ($))| -- Copyright 2006-2015 Mitchell mitchell.att.foicica.com. See LICENSE. | |
| -- HAML LPeg lexer. | |
| local l = require('lexer') | |
| local token, word_match = l.token, l.word_match | |
| local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V | |
| local M = {_NAME = 'haml'} | |
| -- Whitespace. |
| # DATA PROVIDED TO US. STRUCTURE CANNOT BE MODIFIED! WELCOME TO THE REAL WORLD PRINCESS | |
| sizes = [ | |
| { | |
| "name": "item_1", | |
| "size_in_mL": "100mL", | |
| "alternate_identifier": "axc45" | |
| }, | |
| { | |
| "name": "item_2", |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
| const insert = (fn = (a, b) => a < b, item, list = []) => { | |
| if (!list.length) { | |
| return [item]; | |
| } | |
| if (list.length === 1) { | |
| return fn(item, list[0]) ? [item, list[0]] : [list[0], item]; | |
| } | |
| let min = 0; | |
| let max = list.length - 1; | |
| while (true) { |