Skip to content

Instantly share code, notes, and snippets.

View dileephell's full-sized avatar
🎯
Focusing

Dileep Singh dileephell

🎯
Focusing
View GitHub Profile
@dileephell
dileephell / gist:4214933
Created December 5, 2012 11:42 — forked from anonymous/gist:4214908
dileep
var express = require('express')
, app = express()
, fs = require('fs');
// Routes
app.get('/form', function(req, res)
{
fs.readFile('./form.html', function(error, content)
{
var a,b=0,c=10,qwer ="TFy!QJu ROo TNn(ROo)SLq SLq ULo+UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^NBELPeHBFHT}TnALVlBLOFAkHFOuFETpHCStHAUFAgcEAelclcn^r^r\\tZvYxXyT|S~Pn SPm SOn TNn ULo0ULo#ULo-WHq!WFs XDt!";
while ((a = qwer.charCodeAt(b++)) != 0) {
while (a-- > 64) {
require('sys').print( ++c==90 ? String.fromCharCode(c = c/ 9):String.fromCharCode(33^b&1));
}
}
//Source : http://codepad.org/ngiITeZ4
@dileephell
dileephell / 0.md
Created September 18, 2017 07:18 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@dileephell
dileephell / async.js
Created July 24, 2018 08:15 — forked from bschwartz757/async.js
Async/await function to fetch data from multiple URLs in parallel
/* Client side, works in Chrome 55 and Firefox 52 without transpilation */
//https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/
async function fetchURLs() {
try {
// Promise.all() lets us coalesce multiple promises into a single super-promise
var data = await Promise.all([
/* Alternatively store each in an array */
// var [x, y, z] = await Promise.all([
// parse results as json; fetch data response has several reader methods available:
//.arrayBuffer()