- install dnsmasq
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
- edit
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
| /** | |
| * General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts. | |
| * | |
| * Note that this uses an older fork of stable-diffusion | |
| * with the 'txt2img.py' script, and that script was modified to | |
| * support the --outfile command. | |
| */ | |
| var { spawn, exec } = require("child_process"); | |
| var path = require("path"); |
| function jrnl(){ | |
| mkdir -p "$HOME/.journal/" | |
| if [ -z "$1" ]; then | |
| local esc=$(printf '\033') | |
| local prev=$([[ `date +"%u"` == "1" ]] && echo `date -v-3d +%F` || echo `date -v-1d +%F`) | |
| if [ -f "$HOME/.journal/`date +"%F"`.txt" ]; then | |
| echo "${esc}[36mToday" | |
| /bin/cat "$HOME/.journal/`date +"%F"`.txt" 2>/dev/null | sed "s/\([0-9:]*\)\(\.*\)/${esc}[35m\1${esc}[39m \2/" | |
| fi | |
| if [ -f "$HOME/.journal/$prev.txt" ]; then |
| "use strict"; | |
| [foo,bar] = TNG(foo,bar); | |
| // NOTE: intentionally not TNG(..) wrapping useBaz(), so that it's | |
| // basically like a "custom hook" that can be called only from other | |
| // TNG-wrapped functions | |
| function foo(origX,origY) { | |
| var [x,setX] = useState(origX); | |
| var [y,setY] = useState(origY); |
| function *main() { | |
| const confirmRequest = { | |
| type: 'confirm', | |
| value: 'Are you sure?', | |
| }; | |
| const confirmResponse = yield confirmRequest; | |
| if (confirmResponse === true) { | |
| const consoleRequest = { | |
| type: 'console', |
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
/usr/local/etc/dnsmasq.confaddress=/local/127.0.0.1
| // Based on http://adit.io/posts/2013-06-10-three-useful-monads.html | |
| import map from 'ramda/src/map' | |
| import compose from 'ramda/src/compose' | |
| import curry from 'ramda/src/curry' | |
| import multiply from 'ramda/src/multiply' | |
| const chain = curry((fn, m) => m.chain(fn)) | |
| const read = m => m.read() |
| // https://github.com/deebloo/rxjs-worker | |
| var observable = Observable.of([0, 1, 2, 3, 4]); | |
| observable | |
| .map(function (data) { | |
| return data.concat([5, 6, 7, 8, 9]); | |
| }) | |
| .workerMap(function (data) { | |
| return data.concat([10,11,12,13,14]);; | |
| }) |
| // Unfortunatelly it stopped working in F# 4.1 after this PR https://github.com/Microsoft/visualfsharp/pull/1650 | |
| // Will ask to revert it | |
| type FoldArgs<'t> = FoldArgs of ('t -> 't -> 't) | |
| let inline foldArgs f (x:'t) (y:'t) :'rest = (FoldArgs f $ Unchecked.defaultof<'rest>) x y | |
| type FoldArgs<'t> with | |
| static member inline ($) (FoldArgs f, _:'t-> 'rest) = fun (a:'t) -> f a >> foldArgs f | |
| static member ($) (FoldArgs f, _:'t ) = f |
| require('babel-core/register'); | |
| var babel = require('babel-core'); | |
| var gulp = require('gulp'); | |
| var speckjs = require('speckjs'); | |
| var tape = require('tape'); | |
| var through = require('through2'); | |
| function requireFromBuffer(buffer) { | |
| var m = new module.constructor(); | |
| m.paths = module.paths; |
| dependencies: | |
| pre: | |
| - source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list | |
| - wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add - | |
| - sudo apt-get update | |
| - sudo apt-get install rethinkdb=1.16.3~0precise | |
| - sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf | |
| - sudo /etc/init.d/rethinkdb restart |