Skip to content

Instantly share code, notes, and snippets.

@remojansen
remojansen / class_decorator.ts
Last active January 17, 2026 16:35
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@btroncone
btroncone / ngrxintro.md
Last active February 26, 2026 10:29
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@micjamking
micjamking / _triangle-mixin.scss
Created March 22, 2017 02:47
Sass Triangle Shape Mixin
/**
* Triangle CSS Shape
* https://css-tricks.com/examples/ShapesOfCSS/
* @usage @include triangle('down', 10px, #111)
*/
@mixin triangle ($direction: 'up', $size: 100px, $color: red){
width: 0;
height: 0;
@if $direction == 'up' {
@adambene
adambene / coroutines-and-generators.js
Last active August 5, 2024 23:45
Coroutines and generators in JavaScript
function* delays() {
let a = yield delay(800, "Hello, I'm an");
console.log(a);
let b = yield delay(400, "async coroutine!");
console.log(b);
}
const coroutine = nextValue => iterator => {
const { done, value } = iterator.next(nextValue);
@jeffpamer
jeffpamer / encode.sh
Created March 16, 2018 19:38
Smooth Scrubbing Web Video FFMPEG Mega Command
ffmpeg -i input.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -an -vf "scale=-1:1440, reverse" -preset veryslow -g 2 output.mp4
// -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
// Encode for web with a good balance of browser compatibility and compression ratio
// -an
// Strip audio tracks
// -vf "scale=-1:1440, reverse"
// Scale video to 1440px wide, maintaining aspect ratio