My dynamic gist.
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
function mystringify(input) { | |
var key, type, retVal = ""; | |
for(key in input) { | |
if (input.hasOwnProperty(key)) { | |
type = typeof(input[key]); | |
if (type === 'array' || type === 'object') { | |
retVal += key + ": " + type + ", "; | |
} else { | |
retVal += key + ": " + input[key] + ", "; | |
} |
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
// See http://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/ | |
(function(global) { | |
// Maintain a map of already-encountered types for super-fast lookups. This | |
// serves the dual purpose of being an object from which to use the function | |
// Object.prototype.toString for retrieving an object's [[Class]]. | |
var types = {}; | |
// Return a useful value based on a passed object's [[Class]] (when possible). | |
Object.toType = function(obj) { |
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
*~ | |
node_modules |
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
bogdanbiv@bogdanbiv-P35-DS3:~/WebstormProjects$ mkdir npmtest | |
bogdanbiv@bogdanbiv-P35-DS3:~/WebstormProjects$ cd npmtest/ | |
bogdanbiv@bogdanbiv-P35-DS3:~/WebstormProjects/npmtest$ npm install jpegtran-bin | |
npm http GET https://registry.npmjs.org/jpegtran-bin | |
npm http 304 https://registry.npmjs.org/jpegtran-bin | |
npm http GET https://registry.npmjs.org/colors | |
npm http GET https://registry.npmjs.org/which | |
npm http 304 https://registry.npmjs.org/colors | |
npm http 304 https://registry.npmjs.org/which |
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
info: Welcome to Nodejitsu bogdanb | |
info: jitsu v0.12.7, node v0.8.14 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command deploy | |
info: Skipping require-analyzer because noanalyze option is set | |
info: Skipping require-analyzer because noanalyze option is set | |
warn: Local package version appears to be old | |
warn: The package.json version will be incremented automatically | |
warn: About to write /home/bogdanbiv/WebstormProjects/life-trackr/package.json | |
data: |
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
// https://codegolf.stackexchange.com/questions/151537/alternating-bit-smearing | |
// CodeGolf - alternating bit smearing over trailing 00 for numbers in base 2 | |
smear = function (num) { | |
const old = num; | |
let replaces = 0, remind = num%4===0, supl = 0; | |
while (remind) { | |
console.log(remind); | |
remind?replaces++:0; |
I know there is a lot of confusion around Observables
, Iterables
, AsyncIterables
and AsyncObservables
. Let's try to break this down and the reasons for each.
When it comes to collections, you have two ways of thinking about collections, push versus pull. With pull, the consumer is in control of when you get the items, but with push, you get the values when the producer is ready.