Usage:
var t = require('transit-js')
var r = t.reader('json')
var child = require('child_process').fork('ancs_process.js', {
env: {ABLE_HCI_DEVICE_ID: 1}})
.on('message', function(m) {
console.log(r.read(m))})| // Catch errors early | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| namespace EithersAndOptionals | |
| { | |
| struct Either<T1, T2> where T1 : class where T2 : class |
| Warning (emacs): Unable to activate package `with-editor'. | |
| Required package `dash-2.11.0' is unavailable | |
| Warning (emacs): Unable to activate package `solarized-theme'. | |
| Required package `dash-2.6.0' is unavailable | |
| Warning (emacs): Unable to activate package `magit-popup'. | |
| Required package `dash-2.11.0' is unavailable | |
| Warning (emacs): Unable to activate package `magit'. | |
| Required package `dash-2.11.0' is unavailable | |
| Warning (emacs): Unable to activate package `git-commit'. | |
| Required package `dash-2.11.0' is unavailable |
| (println "loading deps") | |
| (require | |
| '[cljs.build.api :as build]) | |
| (defn release [] | |
| (build/build | |
| "src" | |
| {:main 'fmp.core | |
| :output-to "release/release.js" |
| var size = '474x'; // alts: 60x60, 236x, 736x, orig | |
| var n = 0; | |
| var result = $('.BoardPage .Pin').map(function (_, it) { | |
| var url = $(it).find('.pinHolder > a').attr('href'); | |
| return { | |
| desc: $(it).find('.pinDescription').text().trim(), | |
| url: url, | |
| id: +url.split('/')[2], | |
| n: n++ | |
| }; |
| /Users/sander/Code/fmp/out/cljs/core.cljs:261 | |
| (js/Error. | |
| ^ | |
| Error: No protocol method ReadPort.take! defined for type null: | |
| at cljs$core$missing_protocol (/Users/sander/Code/fmp/out/cljs/core.cljs:261:4) | |
| at cljs$core$async$impl$protocols$take_BANG_ (/Users/sander/Code/fmp/out/cljs/core/async/impl/protocols.js:27:34) | |
| at cljs$core$async$impl$ioc_helpers$take_BANG_ (/Users/sander/Code/fmp/out/cljs/core/async/impl/ioc_helpers.js:103:68) | |
| at /Users/sander/Code/fmp/out/cljs/core/async.js:783:52 | |
| at /Users/sander/Code/fmp/out/cljs/core/async.js:888:51 | |
| at cljs.core.async.pipe.cljs$core$IFn$_invoke$arity$3.cljs.core.async.impl.dispatch.run.call.cljs$core$async$state_machine__18606__auto____1 (/Users/sander/Code/fmp/out/cljs/core/async.js:909:4) |
| (defn- before [begin] | |
| (fn [{:keys [time]}] | |
| (<= time begin))) | |
| (defn- weighted [weigh now ival] | |
| (fn [{:keys [time] :as entry}] | |
| (assoc entry :weight (weigh (- 1 (/ (- now time) ival)))))) | |
| (defn- pop-while [pred queue] | |
| (loop [q queue] | |
| (if (and (not (empty? q)) | |
| (pred (peek q))) |
| (ns om-tutorial.core | |
| (:require [goog.dom :as gdom] | |
| [om.next :as om :refer-macros [defui]] | |
| [om.dom :as dom])) | |
| (enable-console-print!) | |
| (def init-data | |
| {:current-user {:email "[email protected]"} | |
| :items [{:id 0 :title "Foo"} |
| (println "loading deps") | |
| (require | |
| '[figwheel-sidecar.system :as sys] | |
| '[com.stuartsierra.component :as component] | |
| '[cljs.build.api :as build]) | |
| (def system | |
| (sys/create-figwheel-system (sys/fetch-config))) |
Usage:
var t = require('transit-js')
var r = t.reader('json')
var child = require('child_process').fork('ancs_process.js', {
env: {ABLE_HCI_DEVICE_ID: 1}})
.on('message', function(m) {
console.log(r.read(m))})| var bleancs = require('ble-ancs') | |
| var t = require('transit-js') | |
| var writer = t.writer('json') | |
| var reader = t.reader('json') | |
| function status(v) { | |
| return t.map([t.keyword('type'), t.keyword('status'), | |
| t.keyword('value'), t.keyword(v)])} | |
| function notif(v) { | |
| return t.map([t.keyword('type'), t.keyword('notification'), |