The examples are illustrated using the following command-line tools:
This file contains hidden or 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
const email = require("email-addresses") | |
const getStdin = require('get-stdin') | |
const R = require('ramda') | |
getStdin().then(str => { | |
const lines = str.split('\n') | |
const sortedLines = R.sortBy(l => email.parseOneAddress(l).parts.domain.tokens, lines) | |
R.forEach(l => console.log(l), sortedLines) | |
}) |
This file contains hidden or 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
const R = require('ramda') | |
const plot = require('plotter').plot | |
const randomBoolean = () => Math.random() > 0.5 | |
const randomOneOrMinusOne = () => randomBoolean() ? 1 : -1 | |
const randomWalk = (length) => R.times(randomOneOrMinusOne, 100) | |
const randomWalkEnd = (length) => R.sum(randomWalk(length)) | |
const manyRandomWalks = R.times(() => randomWalkEnd(100), 1000000) | |
const distribution = R.countBy(R.identity, manyRandomWalks) | |
const values = R.map((x) => distribution[x], R.range(-100, 100)) |
This file contains hidden or 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
const ioredis = require('ioredis') | |
const uuid = require('node-uuid') | |
const redis = new ioredis() | |
const request = { | |
id: uuid.v1(), | |
utterance: 'kuppi kahvia' | |
} |
This file contains hidden or 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 node | |
var readline = require('readline') | |
var rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
rl.on('line', function(line) { |
Assuming you have cabal:
$ cabal install Cabal cabal-install
$ cabal update
$ cabal install purescript
$ npm install -g pulp
$ mkdir handjobs
$ cd handjobs
$ pulp init
$ pulp run -w
This file contains hidden or 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
Bacon = require 'baconjs' | |
random = require 'node-random' | |
alphabet = "-abcdef".split('') | |
toCharacter = (i) -> alphabet[i] | |
isSeparator = (x) -> x is alphabet[0] | |
isntSeparator = (x) -> ! isSeparator x | |
concat = (acc, v) -> acc + v | |
randomIndex = -> Bacon.fromNodeCallback random.integers, { minimum: 0, maximum: alphabet.length - 1 } |
This file contains hidden or 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
Install drivers from http://www.dymo.com/en-US/dymo-user-guides | |
Plug the dymo into your USB port. | |
# Show printers | |
$ lpstat -p | |
printer DYMO_LabelWriter_450_Turbo is idle. enabled since Fri Dec 5 20:04:19 2014 | |
Ready to print. | |
# Set Dymo as default printer | |
$ lpoptions -d DYMO_LabelWriter_450_Turbo |
This file contains hidden or 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
Install http://sourceforge.net/projects/osxfuse | |
System Preferences -> | |
Security & Privacy -> | |
General -> | |
Allow apps downloaded from: Anywhere | |
Install http://sourceforge.net/projects/fuse-ext2 | |
Open /System/Library/Filesystems/fuse-ext2.fs/fuse-ext2.util in your text editor. |
This file contains hidden or 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
# Script for transitioning between two scenes: config.fromSceneId to config.toSceneId. | |
# Note: both scenes must have exactly the same lights. | |
# Set your own configuration in config object. | |
_ = require('lodash') | |
Bacon = require('baconjs').Bacon | |
moment = require('moment') | |
request = require('request') | |
WebSocket = require('ws') |
NewerOlder