Skip to content

Instantly share code, notes, and snippets.

View Willmo36's full-sized avatar

Max Willmott Willmo36

  • SkipTheDishes
  • Saskatoon
View GitHub Profile
@mikelfcosta
mikelfcosta / anyComponent.jsx
Last active October 9, 2019 17:29
A basic log object and React 16.9 Profiler callback function to evaluate the number and speed of mounts and updates of a React component. Useful for testing tiny differences in components like if the usage of useMemo or useCallback hooks are improving or worsening the Component.
import React, {Profiler} from 'react';
import callback from './profiler';
function anyComponent() {
return (
<Profiler id="any-component" onRender={callback}>
<div>Some Component</div>
</Profiler>
);
}
@Willmo36
Willmo36 / keybindings.json
Last active November 11, 2016 11:13
VSCode keybindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+alt+l",
"command": "editor.action.formatDocument"
},
{
"key": "alt+a",
"command": "editor.action.replaceAll",
"when": "editorFocus"
@kolodny
kolodny / script.js
Created November 12, 2015 21:01
Find all used dependancies in project
#!/bin/bash
REGEX=$(node -e 'var pkg = require("./package");console.log(Object.keys(pkg.devDependencies).concat(Object.keys(pkg.dependencies)).join("\\|"))')
grep -iH "'$REGEX'" `find . -name "*.js" | grep -v 'node_modules\|bundle'`
@gaearon
gaearon / reduce-store-time-travel.js
Last active January 30, 2024 05:08
Time travelling concept with reducey stores and state atoms inspired by https://gist.github.com/threepointone/43f16389fd96561a8b0b#comment-1447275
/**
* Stores are just seed + reduce function.
* Notice they are plain objects and don't own the state.
*/
const countUpStore = {
seed: {
counter: 0
},
reduce(state, action) {
@tkafka
tkafka / LICENSE.txt
Last active September 5, 2019 13:38
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing