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
/** | |
* usage | |
* DIR='public/js' node directory-size.js | |
* => "size of public/js is: 12,432 | |
*/ | |
var fs = require('fs'), | |
_ = require('./underscore'); // requires underscore for _.flatten() | |
function format(n) { |
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
<script> | |
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){ | |
js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);} | |
}(document,"script","twitter-wjs"); | |
</script> |
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
require(["helper/util"], function(util) { | |
//This function is called when scripts/helper/util.js is loaded. | |
//If util.js calls define(), then this function is not fired until | |
//util's dependencies have loaded, and the util argument will hold | |
//the module value for "helper/util". | |
}); |
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
<script id="adlayerScript" async="true" src="//api.adlayerjavascriptsdk.com/page.min.js?page=82e719877b60e205471a9d8ef00564ab&site=82e719877b60e205471a9d8ef0055af6" language="javascript" type="text/javascript" ></script> |
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
var docs = [ | |
{ _id: 'a82e5e9a093b197960f69dfa17005132', | |
_rev: '1-70aa8fe77bbe596bded4a9de3aa185e4' | |
}, | |
{ _id: 'a82e5e9a093b197960f69dfa1700534e', | |
_rev: '1-70aa8fe77bbe596bded4a9de3aa185e4' | |
} | |
] | |
docs = docs.map(function(doc){ |
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
const {expect} = require('chai'); | |
const fetch = require('node-fetch'); | |
const Polly = require('@pollyjs/core').Polly; | |
const FetchAdapter = require('@pollyjs/adapter-fetch'); | |
const FSPersister = require('@pollyjs/persister-fs'); | |
global.fetch = fetch; | |
global.Request = fetch.Request; | |
global.Response = fetch.Response; |
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
var modal = document.getElementById('myModal'); | |
var btn = document.getElementById("myBtn"); | |
var span = document.getElementsByClassName("close")[0]; | |
btn.onclick = function () { | |
modal.style.display = "block"; | |
} | |
span.onclick = function () { | |
modal.style.display = "none"; | |
} | |
window.onclick = function (event) { |
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://webtask.io/docs/model | |
module.exports = function(cb) { | |
cb(null, { i_am: 'done '}); | |
} |
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
/** | |
* pure smallEnought version | |
* @param {array} a | |
* @param {number} limit | |
*/ | |
const smallEnought = ([head, ...tail], limit) => (!head && !tail.length) || ((head > limit) ? false : smallEnought(tail, limit)) |
OlderNewer