Skip to content

Instantly share code, notes, and snippets.

View pointofpresence's full-sized avatar
🏠
Working from home

ReSampled pointofpresence

🏠
Working from home
View GitHub Profile
@pointofpresence
pointofpresence / 1661875862.js
Created August 30, 2022 16:11
Created with Copy to Gist
padding: min(85%, 9.75em) 0;
@pointofpresence
pointofpresence / 1661875673.txt
Created August 30, 2022 16:07
Created with Copy to Gist
Easing functions
http://gizma.com/easing/#quad1
Math.easeInOutCirc = function (t, b, c, d) {
t /= d/2;
if (t < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
t -= 2;
return c/2 * (Math.sqrt(1 - t*t) + 1) + b;
@pointofpresence
pointofpresence / 1661875637.txt
Created August 30, 2022 16:07
Created with Copy to Gist
Conditionally adding entries inside Array and object literals
http://2ality.com/2017/04/conditional-literal-entries.html
@pointofpresence
pointofpresence / 1661875589.txt
Created August 30, 2022 16:06
Created with Copy to Gist
https://stackoverflow.com/questions/5651654/ffmpeg-how-to-split-video-efficiently - VIDEO SPLIT
time ffmpeg -v quiet -y -i input.ts -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 -sn test1.mkv
time ffmpeg -v quiet -y -i input.ts -vcodec copy -acodec copy -ss 00:30:00 -t 01:00:00 -sn test2.mkv
@pointofpresence
pointofpresence / 1661875533.txt
Created August 30, 2022 16:05
Created with Copy to Gist
https://stackoverflow.com/questions/15909489/text-overflow-ellipsis-on-two-lines
overflow: hidden;
text-overflow: ellipsis;
// Overloads
function conv(a: string): number;
function conv(a: number): string;
function conv(a: string | number): string | number {
// ...
}
let a;
let b = 0;
// assign a value only if current value is null or undefined
a ??= 'default'; // a is now 'default'
b ??= 5; // b is still 0
function getValue(val?: number): number | 'nil' {
// Will return 'nil' if `val` is falsey (including 0)
// return val || 'nil';
// Will only return 'nil' if `val` is null or undefined
return val ?? 'nil';
}
@pointofpresence
pointofpresence / 1661497879.js
Created August 26, 2022 07:11
Created with Copy to Gist
let a;
let b = 1;
// assign a value only if current value is truthy
a &&= 'default'; // a is still undefined
b &&= 5; // b is now 5
@pointofpresence
pointofpresence / 1661497852.js
Created August 26, 2022 07:10
Created with Copy to Gist
Basic tuples
let myTuple: [ string, number, boolean? ];
myTuple = [ 'test', 42 ];