- You can omit parenthesis in function calls, if your argument is a string or a table
myFunc"hello"
myFunc{1,2,3}- Variable number of function arguments
| { | |
| "html5 boilerplate": { | |
| "scope": "html", | |
| "prefix": "boil", | |
| "body": [ | |
| "<!DOCTYPE html>", | |
| "<html lang=\"en\">", | |
| " <head>", | |
| " <meta charset=\"UTF-8\">", | |
| " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">", |
| import readline from 'readline' | |
| export const prompt = query => new Promise(resolve => { | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }) | |
| rl.question(query, function(answer){ | |
| resolve(answer) | |
| rl.close() |
| #!/bin/bash | |
| BLENDER_APP_PATH="/Applications/Blender.app" | |
| if [ ! -d "$BLENDER_APP_PATH" ]; then | |
| echo "Blender not found in /Applications. Please make sure Blender is installed." | |
| exit 1 | |
| fi | |
| BLENDER_PYTHON=$(find "$BLENDER_APP_PATH" -type f -name "python3*" | head -n 1) |
| pip2 install pyobjc |
| // http://svn.webkit.org/repository/webkit/trunk/Source/WebCore/platform/graphics/UnitBezier.h | |
| class UnitBezier { | |
| constructor(p1x,p1y,p2x,p2y){ | |
| // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1). | |
| this.cx = 3.0 * p1x; | |
| this.bx = 3.0 * (p2x - p1x) - this.cx; | |
| this.ax = 1.0 - this.cx - this.bx; | |
| this.cy = 3.0 * p1y; | |
| this.by = 3.0 * (p2y - p1y) - this.cy; | |
| this.ay = 1.0 - this.cy - this.by; |
| const getType = x => Array.isArray(x) ? 'array' : typeof x; |
| const calcWeights = cutoffs => { | |
| let weights = [cutoffs[0]] | |
| for(let i = 1; i < cutoffs.length; i++){ | |
| let weight = cutoffs[i] - cutoffs[i-1] | |
| weights.push(weight) | |
| } | |
| weights.push(1 - cutoffs.at(-1)) | |
| return weights | |
| } |
myFunc"hello"
myFunc{1,2,3}| // @target aftereffects | |
| // altKeyPressed(win), optKeyPressed(mac) ctrlKeyPressed, cmdKeyPressed(mac), shiftKeyPressed, capsLockKeyPressed, numLockKeyPressed | |
| // leftButtonPressed, middleButtonPressed, rightButtonPressed, mouseOver, hasFocus, | |
| //encapsulate the script in a function to avoid global variables | |
| (function (thisObj) { | |
| default xml namespace = "http://www.w3.org/2000/svg"; | |
| var xmlString = """ | |
| <!-- Generator: Adobe Illustrator 23.1.1, SVG Export Plug-In --> |
| faceposition | |
| facerotation | |
| facelefteyeposition | |
| facerighteyeposition | |
| facelookatposition | |
| faceeyeblinkleft | |
| faceeyeblinkright | |
| faceeyelookdownleft | |
| faceeyelookdownright | |
| faceeyelookinleft |