Skip to content

Instantly share code, notes, and snippets.

View bloodyKnuckles's full-sized avatar

Jay Scott ANDERSON bloodyKnuckles

View GitHub Profile
@bloodyKnuckles
bloodyKnuckles / index.js
Last active August 29, 2015 14:21
requirebin sketch
// only gets the LAST table
var http = require('http')
var fs = require('fs')
var trumpet = require('trumpet')
var tr = trumpet()
tr.selectAll('#content .box-content table', function (table) {
table.createReadStream().pipe(fs.createWriteStream('output.html'))
@bloodyKnuckles
bloodyKnuckles / index.js
Last active August 29, 2015 14:21
requirebin sketch
// only gets the FIRST table
var http = require('http')
var fs = require('fs')
var trumpet = require('trumpet')
var tr = trumpet()
var output = fs.createWriteStream('output.html')
var input = tr.selectAll('#content .box-content table').createReadStream()
@bloodyKnuckles
bloodyKnuckles / index.js
Created November 6, 2015 22:41
requirebin sketch
var hs = require('hyperstream')
console.log(hs.select)
@bloodyKnuckles
bloodyKnuckles / Node.js letsencrypt CentOS Digital Ocean
Last active November 3, 2016 14:50
Node.js https letsencrypt tls/ssl certificate setup on CentOS 7.1 x64 (Digital Ocean)
// (on the server command line, get certificate files)
// git clone https://github.com/letsencrypt/letsencrypt
// cd letsencrypt
// ./letsencrypt-auto certonly
// (in the web server directory)
// vim index.js
var https = require('https')
var fs = require('fs')
//* to toggle, add or remove forward slash (first block on = //*, first block off = /*)
var direction = 'left', coord = 'X'
console.log(direction, coord)
/*/
var direction = 'top', coord = 'Y'
console.log(direction, coord)
//*/
Using [rdce](https://github.com/dirk/rdce) with `browserify`d files.
Edit file to be monitored.
Add `_rdce.report()` in location where will be called after action.
- Use `then` if needing to follow promises.
`browserify` file.
`rdce` file.
Open console in browser.
Run app with `rdce`d file.
@bloodyKnuckles
bloodyKnuckles / index.js
Last active May 19, 2016 19:18
requirebin sketch
var h = require('virtual-dom/h')
var diff = require('virtual-dom/diff')
var pv = require('virtual-dom-patch-viewer')
vdom1 = h('div', [
h('div', 'div stuff'),
h('img', {src: 'keepme.png'})
])
vdom2 = h('div', [
DOM$
.flatMapLatest(view =>
Observable
.fromCallback(requestAnomationFrame)()
.map(view)
)
@bloodyKnuckles
bloodyKnuckles / index.js
Last active May 19, 2016 19:04
requirebin sketch
var h = require('virtual-dom/h')
var diff = require('virtual-dom/diff')
var pv = require('virtual-dom-patch-viewer')
vdom1 = h('div', [
h('div', 'div stuff'),
h('a', {href: 'other.html'})
])
vdom2 = h('div', [