Skip to content

Instantly share code, notes, and snippets.

@alexgleith
alexgleith / SimpleLoadS2.ipynb
Last active April 10, 2024 18:38
Simplest example for finding and loading Sentinel-2 data using Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Jesper-Hustad
Jesper-Hustad / AE-spritesheet.js
Created April 12, 2023 20:22
Ater Effects Spritesheet animation
// Add these effects to your spritesheet:
// Slider Control, Linear wipe, Linear wipe (again), Offset
// For Linear wipe 2 set Wipe Angle to 270.0
// Expression for Slider Control > Slider
var fps = 4;
var frames = 6;
(Math.floor(time*fps)%frames)*(100/frames)
@beesandbombs
beesandbombs / spinCubes.pde
Created February 3, 2023 15:10
spinning cubes
float[][] result;
float t, c;
float ease(float p) {
p = c01(p);
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@mnpenner
mnpenner / color.ts
Last active April 22, 2024 02:41
RGB color hex to lightness
// based on https://stackoverflow.com/a/56678483/65387
type RGB = [r: number, g: number, b: number]
const UNK = 255 / 2
/**
* @param hex RGB hex string like "#CCCFDB"
* @returns RGB tuple in [0-255]
*/
@guwidoe
guwidoe / GetLocalOneDrivePath.bas.vb
Last active May 3, 2024 10:23
VBA Function to get the local path of a OneDrive/SharePoint synchronized Microsoft Office file
'Attribute VB_Name = "GetLocalOneDrivePath"
'
' Cross-platform VBA Function to get the local path of OneDrive/SharePoint
' synchronized Microsoft Office files (Works on Windows and on macOS)
'
' Author: Guido Witt-Dörring
' Created: 2022/07/01
' Updated: 2024/04/23
' License: MIT
'
// by dave @beesandbombs :)
float[][] result;
float t, c;
float ease(float p) {
p = c01(p);
return 3*p*p - 2*p*p*p;
}
// by dave
float[][] result;
float t, c;
float ease(float p) {
p = c01(p);
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@akasakakona
akasakakona / YouTube-DL_Batch_Script.bat
Last active May 21, 2023 07:41
A batch script written for those who are not comfortable with command lines when downloading YouTube videos.
@echo off
echo Checking for update...
if exist youtube-dl.exe ( goto :computeSum ) else (
echo It seems like you don't have youtube-dl on your computer.
goto :download
)
:computeSum
setlocal enableextensions enabledelayedexpansion
set /a counter = 0
for /f "delims=" %%i in ('CertUtil -hashfile .\youtube-dl.exe SHA256') DO (
@GoodBoyNinja
GoodBoyNinja / usefuleIncludes.jsx
Last active November 17, 2023 22:26
Things that are useful to include in your script file. Some of them are functionalities poly fills from later versions of JavaScript. This also includes json2.js functions (JSON.parse, JSON.stringify) and other useful functions for working with arrays and objects
(function includes() {
(function IncludeIsArray() {
if (!Array.isArray) {
Array.isArray = function (arg) {
return Object.toString.call(arg) === "[object Array]";
};
}
})();
(function includeJSON() {
@GoodBoyNinja
GoodBoyNinja / mouse.jsx
Last active November 17, 2023 22:26
a mouse object for ExtendScript. This creates a new object called mouse which you can manually (only) update to keep track of your clicks. For example, on a right click you can use Mouse.setRight() to set the "last" property to 2 (mouse button of index 2). Then you can check if your latest click was a right click by calling Mouse.lastIsRight(), …
var Mouse = new (function () {
var mouse = this;
this.last = 0;
this.setLeft = function () {
mouse.last = 0;
};
this.setMiddle = function () {
mouse.last = 1;
};