Skip to content

Instantly share code, notes, and snippets.

View hellsan631's full-sized avatar

Mathew Kleppin hellsan631

View GitHub Profile
@hellsan631
hellsan631 / object_proxy_logger.ts
Last active November 18, 2020 20:51
Creates a proxy which helps for debugging of objects
function createLogHandler(obj: any) {
return new Proxy(
obj,
{
get(target: any, key: any) {
console.groupCollapsed(`Reading from ${key}`)
console.log(`target: ${JSON.stringify(target)}`)
console.log(`value: ${JSON.stringify(target[key])}`)
console.trace()
console.groupEnd()
@esa1975
esa1975 / jumpcutter.md
Created December 14, 2019 02:29
Using jumpcutter to trim silence from videos

jumpcutter - Remove silence from videos

Introduction

One of the most time consuming aspects of editing videos for me is removing silence. I tend to create an outline for a video which I refer to as I record but inevitably have to think as I go which leads to pauses. It can dramatically increase the length of a video and I try to keep mine as short as I can.

I capture an average of two to three times the length of a finished video in raw footage that I then need to edit down. The editing process can take many hours depending on the amount of footage. Anything I can do to reduce that time is huge, not only in time saved but in reducing fatigue and overall making the process much less taxing and enjoyable (this is supposed to be fun!).

@hydrosquall
hydrosquall / index.md
Last active January 8, 2022 19:35
Building Inclusive Code Review Culture
@hellsan631
hellsan631 / 00 - prism.md
Last active January 28, 2019 18:29
React Hooks - Prism

React Hooks make including Prism easy.

I've been learning react hooks recently. I love that you can refactor components now and remove a lot of logic that made components giant, and reuse the same logic another components

The example before extrapolates all that behavior of running Prism inside any component.

You can see how I use this for my blog posts on github

@sebmarkbage
sebmarkbage / The Rules.md
Last active April 22, 2024 04:41
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@ochronus
ochronus / commands.sh
Last active November 21, 2023 11:28
CPU and disk benchmarks
# install sysbench
$ apt-get install sysbench
# CPU benchmark, 1 thread
$ sysbench --test=cpu --cpu-max-prime=20000 run
# CPU benchmark, 64 threads
$ sysbench --test=cpu --cpu-max-prime=20000 --num-threads=64 run
# Disk benchmark, random read. See .fio files in this gist
@jedwood
jedwood / sample-test-1.js
Last active July 4, 2016 23:55
API Testing Example - Part 1
describe('Authentication', function() {
it('errors if wrong basic auth', function(done) {
api.get('/blog')
.set('x-api-key', '123myapikey')
.auth('incorrect', 'credentials')
.expect(401, done)
});
it('errors if bad x-api-key header', function(done) {
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];