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(){ | |
| var tags = { | |
| // [stmt/exp] | |
| // make function | |
| function(elem){ | |
| var body = prv.block(elem) | |
| var name = elem.getAttribute("j:name") || "" | |
| var arguments_name = elem.getAttribute("j:arguments") | |
| var args | |
| if(arguments_name){ |
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 doIf(cond_fn){ | |
| return do_fn => | |
| (...args) => | |
| typeof cond_fn === "function" && typeof do_fn === "function" | |
| && cond_fn(...args) | |
| && do_fn(...args) | |
| } | |
| var doIfTrue = doIf(e => e) | |
| var doIfFalse = doIf(e => !e) |
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 showInherit(obj){ | |
| while(obj = obj.__proto__){ | |
| console.log(obj.constructor) | |
| } | |
| } | |
| function showInheritFn(fn){ | |
| var obj = fn.prototype | |
| do{ | |
| console.log(obj.constructor) | |
| } while(obj = obj.__proto__) |
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.prototype.async = function(pos){ | |
| return (...args) => | |
| new Promise((resolve, reject) => { | |
| var iidx = Object.is(-0, pos) ? args.length : pos | |
| var cb = (...cbarr) => resolve(cbarr) | |
| args.splice(iidx, 0, cb) | |
| this(...args) | |
| }) | |
| } |
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 eif(exp, ift, iff){ | |
| return exp ? ift : iff | |
| } | |
| function let(...args){ | |
| const fn = args.pop() | |
| if(typeof fn !== "function") throw new TypeError("Last argument must be a function.") | |
| return fn.apply(this, args) | |
| } |
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
| <!doctype html> | |
| <textarea id="input"></textarea> | |
| <script> | |
| input.onkeydown = function(eve){ | |
| if(eve.keyCode === 13){ | |
| eve.preventDefault() | |
| var str = this.value | |
| var ss = this.selectionStart | |
| var se = this.selectionEnd |
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 ip2id = ip => | |
| ip.split(".") | |
| .map(e => String.fromCharCode(e)) | |
| .map(e => btoa(e)) | |
| .map(e => e.replace(/=+$/g, "")) | |
| .join("") |
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
| <Window x:Class="wpf_testproj.Window00" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| xmlns:local="clr-namespace:wpf_testproj" | |
| mc:Ignorable="d" | |
| Title="Window00" Height="600" Width="600" | |
| PreviewKeyDown="Window_PreviewKeyDown"> | |
| <Grid x:Name="root_grid"> |
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
| C:\Users\user\Desktop>cscript //E:{1b7cd997-e5ff-4932-a7a6-2a9e636da385} repl.js | |
| Microsoft (R) Windows Script Host Version 5.812 | |
| Copyright (C) Microsoft Corporation. All rights reserved. | |
| > if(true){\ | |
| > 1\ | |
| > } | |
| 1 | |
| > var a = 10 | |
| undefined |
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
| C:\Users\user\Desktop>cscript jsconsole.js //E:{1b7cd997-e5ff-4932-a7a6-2a9e636da385} | |
| Microsoft (R) Windows Script Host Version 5.812 | |
| Copyright (C) Microsoft Corporation. All rights reserved. | |
| > var a = 1 | |
| > a | |
| 1 | |
| > const b = 2 |