This file contains 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 a(b, { c = 1 } = {}) { | |
console.log(b, c); | |
} | |
// a(2) -> '2 1' | |
// a(2, { c: 3 }) -> '2 3' | |
// a(2, {}) -> '2 1' |
This file contains 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
// https://discourse.threejs.org/t/iphone-how-to-remove-text-selection-magnifier/47812/11 | |
function createHandler(func, timeout) { | |
let timer = null; | |
let pressed = false; | |
return function() { | |
if (timer) { |
This file contains 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
import bpy | |
from mathutils import Vector | |
# Edit these: | |
offset = 1 # Offset is the interval between each brick appearance | |
startFrame = 0 # Start Frame is the frame that the brick animation starts on | |
# Variables | |
frameNum = startFrame | |
selectedBricks = bpy.context.selected_objects |
This file contains 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
Array.prototype.equals=function(a){for(var b=0;b<this.length;b++)if(this[b]!=a[b])return!1;return!0}; | |
[0,1].equals([0,1]) // true |
This file contains 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
// Both numbers and letters | |
function mixedID() { | |
var now = new Date(); | |
timestamp = now.getFullYear().toString(); | |
timestamp += (now.getMonth < 9 ? '0' : '') + now.getMonth().toString(); | |
timestamp += ((now.getDate < 10) ? '0' : '') + now.getDate().toString(); | |
timestamp += now.getHours().toString(); | |
timestamp += now.getMinutes().toString(); | |
timestamp += now.getSeconds().toString(); |
This file contains 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 scrollToEl(el) { | |
var rect = el.getBoundingClientRect(), | |
scrollTop = window.pageYOffset || document.documentElement.scrollTop, | |
scrollLeft = window.pageXOffset || document.documentElement.scrollLeft, | |
elTop = rect.top + scrollTop, | |
elLeft = rect.left + scrollLeft; | |
window.scrollTo({ | |
top: elTop, | |
left: elLeft, |