This file contains hidden or 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 sample = "// hey"; | |
| var bluebird = require('bluebird'); | |
| var pogoscript = require('pogo'); | |
| var $ = require('jquery'); | |
| var CodeMirror = require('codemirror'); | |
| $(function () { | |
| $('body').css({ |
This file contains hidden or 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
| package com.adambene.gist; | |
| import static com.adambene.gist.ThreadStateMachine.Transition.CREATE; | |
| import static com.adambene.gist.ThreadStateMachine.Transition.FINISH; | |
| import static com.adambene.gist.ThreadStateMachine.Transition.RESUME; | |
| import static com.adambene.gist.ThreadStateMachine.Transition.WAIT; | |
| import java.util.logging.Level; | |
| import java.util.logging.Logger; |
This file contains hidden or 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
| <input type="file" /> |
This file contains hidden or 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
| <div class="upload-btn-wrapper"> | |
| <button class="btn">Upload a file</button> | |
| <input type="file" name="myfile" /> | |
| </div> |
This file contains hidden or 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
| // define an async operation that rejects if the path is not a string | |
| const someAsyncOperation = async (path) => { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| if (typeof path === 'string') { | |
| resolve(`Hello Panda! Path is = ${path}`); | |
| } else { | |
| reject(new Error(`Path is not a string. Path (${typeof path}) = ${path}`)); | |
| } | |
| }, 1000); |
This file contains hidden or 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
| // transpiled to ES5 | |
| 'use strict'; | |
| var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | |
| function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | |
| var someAsyncOperation = function () { | |
| var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(path) { |
This file contains hidden or 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
| map _ [] = [] | |
| map f (x:xs) = f x : map f xs |
This file contains hidden or 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 map = (f, [x, ...xs]) => ( | |
| (x === undefined && xs.length === 0) ? [] | |
| : [f(x), ...map(f, xs)] | |
| ); |
This file contains hidden or 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
| multiply = (n, m) => (n * m) | |
| multiply(3, 4) === 12 // true | |
| curryedMultiply = (n) => ( (m) => multiply(n, m) ) | |
| triple = curryedMultiply(3) | |
| triple(4) === 12 // true |
This file contains hidden or 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
| curryedMultiply = (n) => (m) => n * m | |
| curryedMultiply(3)(4) === 12 // true | |
| multiply = (n, m) => curryedMultiply(n)(m) | |
| multiply(3, 4) === 12 // true |
OlderNewer