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 vars | |
var a = 'foo'; | |
function printA() { | |
console.log('a is ' + a); | |
} | |
// scope | |
{ | |
var a = 'bar'; |
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 resolvers = { | |
get([obj, path = ''], name) { | |
if (name === '__internal') { | |
return obj | |
} | |
return obj[name] || new Proxy([obj, `${path}${name}.`], resolvers) | |
}, | |
set([obj, path = ''], name, value) { | |
obj[`${path}${name}`] = value | |
return value |
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 Person = (() => { | |
const getName = privateProperties => privateProperties.name.split(' ')[0] | |
const setName = (privateProperties, name) => { | |
privateProperties.name = name | |
} | |
const getAge = privateProperties => privateProperties.age - 4 | |
const setAge = (privateProperties, age) => { | |
privateProperties.age = age | |
} |
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
{ | |
"name": "npm-install-test", | |
"version": "1.0.0", | |
"lockfileVersion": 1, | |
"requires": true, | |
"dependencies": { | |
"sample-npm-package-prepack": { | |
"version": "file:../../sample-npm-package-prepack", | |
"dependencies": { | |
"@babel/cli": { |
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
Show hidden characters
{ | |
"bootstrapped": true, | |
"ignore_vcs_packages": | |
[ | |
"Theme - Spacegray" | |
], | |
"in_process_packages": | |
[ | |
], | |
"installed_packages": |
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
let | |
nixpkgs = import <nixpkgs> {}; | |
overlays = [ | |
(self: super: { aa-bb = "${self.aa} ${self.bb}"; }) | |
(self: super: { aa = "a"; }) | |
(self: super: { bb = "b"; }) | |
(self: super: { aa = super.aa + "a"; }) | |
(self: super: { bb = "bbb"; }) | |
]; | |
inherit (builtins) foldl'; |
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
let | |
nixpkgs = import <nixpkgs> { | |
overlays = [ | |
# This overlay obtains self.bash and super.bash, and save them under the | |
# attrs "bash-from-self" and "bash-from-super" for further examination | |
(self: super: { | |
bash-from-self = self.bash; | |
bash-from-super = super.bash; | |
}) | |
]; |
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
fix = \f -> let r = f r in r -- retuns f (f (f (f (f ...)))), sounds like infinile loop? | |
data D = D { | |
a :: Int, | |
b :: Int, | |
c :: Int | |
} deriving (Show) | |
d = (\self -> D 1 (a self + 1) (a self + b self)) -- Can reference itself! | |
-- ^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ |
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 makeOverridable = obj => ({ | |
...obj, | |
override: overrides => makeOverridable({ | |
...obj, | |
...overrides, | |
}), | |
}) |
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
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; |