Skip to content

Instantly share code, notes, and snippets.

This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreibixj5x3now662kuo2agzwt4zfcsv45fix5pkorc5by3boyuxz66m ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@21paradox
21paradox / reconnect-stream.js
Last active August 19, 2016 01:29
websocket-stream with reconnect core
var websocket_stream = require('websocket-stream');
var inject = require('reconnect-core');
var PassThrough = require('stream').PassThrough;
var Duplex = require('stream').Duplex;
var reconnect = inject(function (_url) {
return websocket_stream(_url);
});
@21paradox
21paradox / example.js
Last active August 17, 2016 02:59
dnode with websocket and reconnect
````js
var dnode = require('dnode');
var PassThrough = require('stream').PassThrough;
var inject = require('reconnect-core');
var reconnect = inject(function (_url) {
return websocket_stream(_url);
});
@21paradox
21paradox / example.js
Created January 9, 2016 08:46
render very large text in html page
var el = document.body; // any parent html element
var iframe = document.createElement('iframe');
el.appendChild(iframe);
var doc = (iframe.contentWindow.document || iframe.contentDocument);
(iframe.frameElement || iframe).style.cssText = "width: 100%; height: 100%; border:0";
@21paradox
21paradox / ie6 css expression shims
Last active August 29, 2015 14:11
IE6 css expression shims
ie6 maxHeight shim
.maxHeight {
max-hegiht: 182px;
_height: expression(this.scrollHeight > 182 ? '182' : this.scrollHeight);
}
ie6 maxWidth shim
.maxWidth {
max-width: 396px;
_width: ~"expression(this.scrollWidth > 396 ? '396' : this.scrollWidth)";