A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
(function (e, a, h, f, c, b, d) { | |
c = a.createElement("script"); | |
c.type = "text/javascript"; | |
c.src = "https://rawgithub.com/marmelab/gremlins.js/master/gremlins.min.js"; | |
c.onload = c.onreadystatechange = function () { | |
if (!b && (!(d = this.readyState) || d == "loaded" || d == "complete")) { | |
h(); | |
f(c).remove() | |
} | |
}; |
package hash | |
type Hasher interface { | |
Update(uint8) | |
UpdateArray([]uint8) | |
Hash() uint32 | |
Reset() | |
} | |
const ( |
package main | |
import ( | |
"fmt" | |
"math" | |
"time" | |
) | |
func epoch_seconds(date time.Time) (sec float64) { | |
/* Returns the number of seconds from the epoch to date. */ |
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
The current kernel/drivers of Fedora 24 do not support the Wifi chip used on my Mac Book Pro. Proprietary Broadcom drivers are packaged and available in the rpmfusion repo.
Verify that your card is a Broadcom using: lspci -vnn -d 14e4:
Sample output:
02:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)
Install the rpmfusion repo, note only "nonfree" is required, as the Broadcom Driver is proprietry: http://rpmfusion.org/
// This script will boot app.js with the number of workers | |
// specified in WORKER_COUNT. | |
// | |
// The master will respond to SIGHUP, which will trigger | |
// restarting all the workers and reloading the app. | |
var cluster = require('cluster'); | |
var workerCount = process.env.WORKER_COUNT || 2; | |
// Defines what each worker needs to run |
This article is now published on my website: A one-off git repo server.
#!/bin/bash | |
set -e | |
if [[ -z ${K8S_JVM_POD} ]]; then | |
echo "K8S_JVM_POD not defined" | |
exit 1 | |
fi | |
EXEC="kubectl exec ${K8S_JVM_POD}" | |
CP="kubectl cp ${K8S_JVM_POD}" |
easterEgg.BadWorder.list={ | |
"4r5e":1, | |
"5h1t":1, | |
"5hit":1, | |
a55:1, | |
anal:1, | |
anus:1, | |
ar5e:1, | |
arrse:1, | |
arse:1, |
The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows: