- 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
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 |
// https://github.com/beatgammit/gzip-js/blob/master/lib/gzip.js | |
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | |
const gzip = require('gzip-js'); | |
},{"gzip-js":6}],2:[function(require,module,exports){ | |
(function () { | |
'use strict'; | |
var table = [], | |
poly = 0xEDB88320; // reverse polynomial |