https://github.com/torgeir/dotfiles/blob/master/gitconfig#L5-L14
git cherry-pick <sha>
const domains = ["domain.no"]; | |
const normalize = s => s.replace(/[^a-z]/g, "") | |
const status = d => new Promise(function (resolve, reject) { | |
const fn = `handle_result_${normalize(d)}`; | |
window[fn] = data => resolve(data); | |
const script = document.createElement("script"); | |
script.src = `https://das2.hostpartner.no/das/${encodeURIComponent(d)}?callback=${encodeURIComponent(fn)}`; | |
script.onload = () => delete window[fn]; | |
script.onerror = function (err) { |
#!/usr/bin/env boot | |
;; https://github.com/boot-clj/boot#install | |
(set-env! | |
:dependencies '[[org.clojure/clojure "1.9.0-RC2"] | |
[org.clojure/data.csv "0.1.4"]]) | |
(require '[clojure.data.csv :as csv] |
const http = require('http'); | |
const server = http.createServer(function (req, res) { | |
res.writeHead(200, { | |
"content-type": "text/plain", | |
"transfer-encoding": "chunked" | |
}); | |
let i = 0; |
public class CalculationExecutor { | |
private final ThreadPoolExecutor executor; | |
public CalculationExecutor() { | |
executor = createThreadPool(1); | |
} | |
public void execute(Runnable runnable) { | |
executor.execute(runnable); |
const Rx = require('rxjs/Rx'); | |
const { createStore, applyMiddleware } = require('redux'); | |
const { createEpicMiddleware, combineEpics } = require('redux-observable'); | |
const inc = n => n + 1; | |
const reducer = function ({ count } = { count: 0 }, { type } = {}) { | |
switch (type) { | |
case "add": | |
return { count: inc(count) }; |
https://github.com/torgeir/dotfiles/blob/master/gitconfig#L5-L14
git cherry-pick <sha>
For a wireless router on 192.168.1.1
with two network interfaces, e.g. wlan0
and
wlan1
, you can expose your gopro's live stream on a port on the router using the following setup.
Connect your machine to wlan0
, ssh to your router 192.168.1.1
, and run these
iptables
rules.
iptables -t nat -I PREROUTING -d 192.168.1.1 -j DNAT --to-destination 10.5.5.9 -p tcp --destination-port 8080
~/Desktop/yarn-jquery-pickadate $ yarn add jquery@2.1.3 | |
~/Desktop/yarn-jquery-pickadate $ yarn add pickadate | |
~/Desktop/yarn-jquery-pickadate $ cat yarn.lock | |
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | |
# yarn lockfile v1 | |
jquery@2.1.3: | |
version "2.1.3" | |
resolved "https://registry.yarnpkg.com/jquery/-/jquery-2.1.3.tgz#6ec55204673d505d39432c5bf5cfad10e1dbad2e" |
const initialState = Immutable.Map({ count: 42 }); | |
const actions = { | |
click: function () { | |
return { type: "click" }; | |
}, | |
asyncClick: function () { | |
return function (dispatch) { | |
setTimeout(() => dispatch(actions.click()), 1000); |
// async debugging in chrome 60 | |
// https://developers.google.com/web/updates/2017/05/devtools-release-notes#step-into-async | |
// cmd/ctrl click result when in `debugger` breakpoint | |
const sleep = s => | |
new Promise(resolve => setTimeout(_ => resolve(s), 1000 * s)); | |
function delayedFetch(url) { | |
debugger; | |
return Promise.resolve() |