Skip to content

Instantly share code, notes, and snippets.

// https://dzone.com/articles/300-ms-click-delay-and-ios-8
// https://patrickhlauke.github.io/touch/tests/results/
// https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure
<button>Click</button>
<p style="color: black;">Delay was <span></span> milliseconds.</p>
<script>
var button = document.querySelector("button"),
span = document.querySelector("span"),
delay;
{
"deploy": {
"subdomain": "testphaser.withkoji.com",
"frontend": {
"output": "dist",
"commands": [
"npm install",
"export NODE_ENV=production && npm run build"
]
}
window.postMessage({ action: 'injectGlobal', payload: { scope: 'general', key: 'startText', value: 'startx' }}, "*")
@rgruesbeck
rgruesbeck / index.js
Created April 24, 2019 06:47
functional sprite: composed move function
const withConstructor = constructor => o => ({
__proto__: { constructor },
...o
});
const mix = (...fns) => x => fns.reduce((y, f) => f(y), x);
const canMove = o => {
return {
...o,
@rgruesbeck
rgruesbeck / gist:174d29f244494ead21e2621f6f0d79ee
Last active April 12, 2019 20:46
koji live preview injection
// listen for post message
// you will need to attach the listener to window instead of document for this to work
window.addEventListener("message", injectHandler, false);
// handle the update
function injectHandler({ data }) {
if (data.action === 'injectGlobal') {
let { scope, key, value } = data.payload;
config[scope][key] = value;
@rgruesbeck
rgruesbeck / coldaddress.sh
Last active November 15, 2018 02:51
create an offline address by coin toss: requires https://github.com/libbitcoin/libbitcoin-explorer
#!/usr/bin/env bash
length=256
bits=()
prvk=""
pubk=""
mnemonic=""
# collect coin flips
function getBits() {
@rgruesbeck
rgruesbeck / random.sh
Last active November 13, 2018 00:53
get random strings from your mic
#!/usr/bin/env bash
clip() {
# sync clipboards
xclip -o | xclip -sel clip
# print to stdout
xclip -o
}
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker
addusertogroup
@rgruesbeck
rgruesbeck / tmuxhelper.txt
Last active December 21, 2017 22:09
tmux helper function that works well with teamocil
mux () {
# tmux helper function
templates="/home/ron/.teamocil/"
if [ -z $1 ]
then
echo "Sessions:"
tmux ls
echo ""
echo "Templates:"
ls $templates
@rgruesbeck
rgruesbeck / commandfu
Last active November 19, 2018 16:45
quickly query commandlinefu.com from the commandline (highlight potentialy malicious commands)
cfu () {
WARN='^.*wget\s-q(O| -O).*$|^.*\|\s(bash |sh ).*$|^.*eval.*$
|$'
QC=$(echo $1 | recode ascii../b64 | sed 's/...$//')
curl "https://www.commandlinefu.com/commands/matching/$1/$QC/plaintext" | egrep --color=always $WARN
}