Skip to content

Instantly share code, notes, and snippets.

@bcomnes
bcomnes / ddnsipv6.sh
Last active March 16, 2017 01:53
IPv6 DDNS client
#!/bin/bash
# https://community.ubnt.com/t5/EdgeMAX/IPv6-DDNS-script/td-p/1082829
run=/opt/vyatta/bin/vyatta-op-cmd-wrapper
domain=leaf.bret.io
key=DDNSAUTHKEY
updateurl="https://${domain}:${key}@ipv6.dyn.dns.he.net/nic/update?hostname=${domain}"
interface=eth1
lastipv6=`cat /config/ipv6address`
outsideipv6=`$run show interfaces ethernet $interface brief | grep "[0-9abcdef]*:[0-9abcdef:]*/"|tr -d '[:space:]'|cut -d/ -f1`
if test `find "/config/ipv6address" -mmin +10080` || [ "$lastipv6" != "$outsideipv6" ]
var request = require('sync-request');
var ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
var res = request('GET', 'https://api.github.com/repos/cfry/dde/releases/latest', {
headers: { 'user-agent': ua}
})
module.exports = {
use: [
'autoprefixer',
'postcss-import',
'postcss-url',
'postcss-browser-reporter',
'postcss-reporter'
],
input: 'index.css',
output: 'dist/bundle.css',
@bcomnes
bcomnes / .gitignore
Last active July 3, 2017 00:08
proxy-morph-bug
node_modules
yarn.lock
package-lock.json
@bcomnes
bcomnes / .gitignore
Last active May 15, 2017 20:07
electron-builder yarn sqlite3 bug
node_modules
@bcomnes
bcomnes / from-buffer.js
Created June 10, 2017 17:24
from-buffer.js
var from = require('from2')
exports.fromBuffer = fromBuffer
function fromBuffer (buffer) {
return from(function (size, next) {
if (buffer.length <= 0) return next(null, null)
var chunk = buffer.slice(0, size)
buffer = buffer.slice(size)
next(null, chunk)
Yoshua Wuyts 9:36 AM
https://github.com/Drakulix/fireplace
Todd Kennedy joined group chat.
Todd Kennedy left group chat.
Todd Kennedy joined group chat.
Todd Kennedy left group chat.
Todd Kennedy joined group chat.
To list all available commands enter "/?".
Dom Event scheduling
<yoshuawuyts> bret: the order of resolution per tick is:
16:18 bret: 1. microtasks; they're part of promises and mutationobservers but you can hook into them. See https://github.com/yoshuawuyts/nanotask
16:18 bret: 2. setTimeout(cb, 0) calls
16:18 bret: 3. requestAnimationFrame() calls
16:19 <bret> Bret Comnes is that all of them?
16:19 <yoshuawuyts> bret: now this is where it gets tricky. If there is any rendering, it'll happen now. If there is none, setTimeout() and RAF will resolve _again_ on the same tick. Not sure about microtasks but suspect them too
16:19 bret: but assuming we modified the dom:
16:20 bret: 4. the render pipeline triggers here. E.g. paints and reflows
var Nanocomponent = require('nanocomponent')
var html = require('bel')
var onIdle = require('on-idle')
var url = require('url')
var TwitterWidgetsLoader = {
src: '//platform.twitter.com/widgets.js',
loading: false,
listeners: [],
interval: 50,
@bcomnes
bcomnes / .gitignore
Last active September 13, 2017 23:04
sticky tables
node_modules