Starter Angular project with ui-router, bootstrap & jquery.
A Pen by Gyula Nyirfalvi on CodePen.
const R = require('ramda'); | |
const BASEURL = "https://en.wikipedia.org/wiki/"; | |
const baseURL = (month,day) => `${BASEURL}${month}_${day}`; | |
const numberOfDays = function(m) { | |
return m === 1 ? 29 : | |
(R.contains(m, [0,2,4,6,7,9,11] )) ? 31 : 30 | |
} |
Starter Angular project with ui-router, bootstrap & jquery.
A Pen by Gyula Nyirfalvi on CodePen.
I hereby claim:
To claim this, I am signing this object:
var handler = { | |
get: function(target, name) { | |
if (name in target) { | |
return [target[name], true] | |
} else { | |
return [null, false] | |
} | |
} | |
[ -f ~/.fzf.bash ] && source ~/.fzf.bash | |
export FZF_DEFAULT_COMMAND="fd . $HOME" | |
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" | |
export FZF_ALT_C_COMMAND="fd -t d . $HOME" |
const COLORED = [220, 0, 0]; // RGB values for sense-hat-led package "setPixel" func | |
const UNCOLORED = [0, 0, 0]; | |
const VERTICAL_OFFSET = 4; // clock will appear at bottom half of the 8x8 matrix | |
const coloredOrNot = bit => [UNCOLORED, COLORED][bit]; | |
const zeroPad = num => str => str.padStart(num, "0"); | |
const toBinary = num => num.toString(2); | |
const explode = str => str.split(""); | |
const eachToNumber = R.map(Number); | |
const explodeAsBinary = R.pipe(toBinary, zeroPad(4), explode, eachToNumber); // 9 => [1, 0, 0, 1] | |
const explodeTimePiece = R.pipe(String, zeroPad(2), explode, eachToNumber); // "8" => [0, 8] |
const hasOnlyEmptyArrFields = obj => { | |
return Object.keys(obj).filter(key => Array.isArray(obj[key])) | |
.reduce((result, incoming) => { | |
return result && obj[incoming].length === 0 | |
}, true) | |
} |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
We need two NPM packages:
npm install midi i3
The "midi" pacakge is a native package, and has its own dependencies and you'll need have build tools installed. (e.g. build-essential package, python, ALSA (which is typically already installed in any linux environment, and libasound2-dev (in ubuntu) or alsa-lib-devel (in fedora/redhat) package).
We typically need to start with finding the port number of the midi device we want to use: