Skip to content

Instantly share code, notes, and snippets.

View codeandcats's full-sized avatar
😸
Wrangling code and herding cats...

Benji codeandcats

😸
Wrangling code and herding cats...
  • Australia
View GitHub Profile
@codeandcats
codeandcats / array.d.ts
Last active July 8, 2021 05:19
Array.filter(Boolean)
declare global {
interface Array<T> {
filter(predicate: typeof Boolean): Exclude<T, undefined | null | false | 0 | ''>[]
}
}
export default global
@codeandcats
codeandcats / fps.ts
Created July 19, 2020 05:18
FPS Counter (Frames Per Second)
export class FpsCounter {
constructor(private maxSamples: number = 100) {}
private samples: number[] = [];
sample() {
this.samples.push(Date.now());
if (this.samples.length > this.maxSamples) {
this.samples.shift();
}
@codeandcats
codeandcats / keybindings.json
Last active April 29, 2019 23:09
VSCode Custom Key Bindings
[
{
"key": "cmd+enter",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},
{
"key": "cmd+enter",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminalFocus"
@codeandcats
codeandcats / guide.md
Last active September 22, 2018 03:18 — forked from askilondz/gistlog.yml
Adaptive Streaming with MPEG-DASH and HLS using AWS

Adaptive Streaming has become the neccessity for streaming video and audio. Unfortantely, as of this post, there isn't a whole lot of tutorials that accumulate all of the steps to get this working. Hopefully this post achieves that. This post focuses on using Amazon Web Services (AWS) to transcode for HLS and DASH and be the Content Delivery Network (CDN) that delivers the stream to your web page. We'll be using Video.js for the HTML5 player as well as javascript support libaries to make Video.js work with HLS and DASH.

So Here's what you need:

Set up three S3 buckets

@codeandcats
codeandcats / chrome-extensions.md
Last active January 14, 2017 05:49
Favourite Chrome Extensions
@codeandcats
codeandcats / AutoHotKey.ahk
Last active June 22, 2016 08:07
AutoHotKey file to simulate common OSX shortcuts in Windows
; Force AHK to replace already running instance of this script with newer version if script is opened again while already running
#SingleInstance force
; --------------- Windows ---------------
; Win+Tab = Alt+Tab
<#Tab::AltTab
>#Tab::AltTab
; --------------- Navigation ---------------