const {PassThrough} = require('stream')
const fs = require('fs')
const d = new PassThrough()
fs.createReadStream('tt2.js').pipe(d) // can be piped from reaable stream
d.pipe(process.stdout) // can pipe to writable stream
d.on('data', console.log) // also like readable
View zf.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
function zero_pad () { | |
n=$1 | |
file=$2 | |
padding=`seq 1 $n | sed 's/.*/0/' | tr -d '\n'` | |
zeroPadded="$padding$file" | |
if test -f "$zeroPadded"; then | |
echo "$zeroPadded exist" | |
else |
View node.js PassThrough stream.md
View docready.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("DOMContentLoaded", function(){ | |
// Handler when the DOM is fully loaded | |
}); |
View script match
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$html = <<<HTML | |
<html> | |
<head> | |
<script src="http://example.com"></script> | |
</head> | |
<body> | |
<div> | |
<script> |
View customevent-polyfill.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent | |
;(function() { | |
if (typeof window.CustomEvent === "function") return false | |
function CustomEvent(event, params) { | |
params = params || { bubbles: false, cancelable: false, detail: undefined } | |
var evt = document.createEvent("CustomEvent") | |
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail) | |
return evt | |
} |
View README.md
JavaScript Classes - ES5 vs ES6
An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
View keybase.md
Keybase proof
I hereby claim:
- I am parallaxisjones on github.
- I am parallaxisjones (https://keybase.io/parallaxisjones) on keybase.
- I have a public key ASCuqWp2LShe3x9SUrSY-mO_BJ4mXHKUsTBdfD2eyLfYjAo
To claim this, I am signing this object:
View .eslintrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"ecmaFeatures": { |
View untrusted-lvl1-solution.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***************** | |
* cellBlockA.js * | |
***************** | |
* | |
* Good morning, Dr. Eval. | |
* | |
* It wasn't easy, but I've managed to get your computer down | |
* to you. This system might be unfamiliar, but the underlying | |
* code is still JavaScript. Just like we predicted. | |
* |
View wpcampus-functionality.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create two taxonomies, Class and Year, for the post type "Lecture" | |
function wpcampuscpt_lecture_taxonomies() { | |
// Add Class taxonomy, make it hierarchical (like categories) | |
$labels = array( | |
'name' => _x( 'Classs', 'taxonomy general name' ), | |
'singular_name' => _x( 'Class', 'taxonomy singular name' ), | |
'search_items' => __( 'Search Classes' ), | |
'all_items' => __( 'All Classes' ), | |
'parent_item' => __( 'Parent Class' ), |
NewerOlder