Metamethod | 5.1 | 5.2 | 5.3 | Syntax | Notes |
---|---|---|---|---|---|
__add |
✔️ | ✔️ | ✔️ | a + b |
|
__sub |
✔️ | ✔️ | ✔️ | a - b |
|
__mul |
✔️ | ✔️ | ✔️ | a * b |
|
__div |
✔️ | ✔️ | ✔️ | a / b |
|
__mod |
✔️ | ✔️ | ✔️ | a % b |
|
__pow |
✔️ | ✔️ | ✔️ | a ^ b |
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
{ | |
"Userscript Meta": | |
{ | |
"description": "Userscript meta heading", | |
"prefix": "!meta", | |
"scope": "typescript,javascript", | |
"body": | |
[ | |
"// ==UserScript==", | |
"// @name ${1}", |
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 samples: any[] = []; | |
//#region Components | |
class Point2DClass | |
{ | |
constructor(public x: number, public y: number) { } | |
toString(): string { return `x: ${this.x}\ny: ${this.y}` } | |
} |
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
console.delayLog = function(delayMs, message) { | |
var style = | |
"color: rgb(249, 162, 34);" + | |
"font-size: 60px;" + | |
"font-weight: bold;" + | |
"text-shadow: 1px 1px 5px rgb(249, 162, 34);" + | |
"filter: dropshadow(color=rgb(249, 162, 34), offx=1, offy=1);"; | |
setTimeout(function() { | |
console.log(message, style); | |
}, delayMs); |
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
/** | |
* For use with [Monaco Editor Playground](https://microsoft.github.io/monaco-editor/playground.html), | |
* otherwise monaco must be loaded via import or another method | |
*/ | |
//#region Initialize | |
//#region Document Intial Text | |
let jsCode = /* js */ ` |
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
#Requires -PSEdition Desktop | |
#Requires -Module 7Zip4Powershell | |
<# | |
.SYNOPSIS | |
Download and install the latest available mpv Windows build | |
.DESCRIPTION | |
Script can either be invoked directly for an immeditate update with default | |
configuration or sourced to access the component functions. Currently only 64 bit builds | |
are enumerated, but the urls can be easily switched in `Get-Latestx64mpvWinBuildUrl` |
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 base = 2, | |
exp = 8, | |
listEnts = false; | |
div.main | |
div.footer | |
div.bubbles | |
- | |
for (var i = 0; i < Math.pow(base, exp); i++) //Small numbers looks nice too |
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
/** | |
* Original code from [comment in microsoft/TypeScript issue #13355](https://github.com/microsoft/TypeScript/issues/13355#issuecomment-313847099) | |
*/ | |
function loooooongTask() { | |
return new Promise<string>(resolve => { | |
setTimeout(() => { | |
resolve("world"); | |
}, 3000); | |
}) |
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
/** | |
* Extension: fabiospampinato.vscode-highlight | |
* For use in user's main/project settings file (settings.json). | |
*/ | |
{ | |
// ... | |
// @region Decorators / Styling | |
// Highlight Decorator - highlight.options | |
"highlight.maxMatches": 500, | |
"highlight.decorations": { "rangeBehavior": 1 }, |
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
// ==UserScript== | |
// @name GM_download emulation | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description emulate GM_download functionality | |
// @require https://github.com/eligrey/FileSaver.js/blob/master/dist/FileSaver.min.js | |
// @grant GM_xmlhttpRequest | |
// @copyright 2014, Jan Biniok | |
// ==/UserScript== |