Skip to content

Instantly share code, notes, and snippets.

View stephenhuh's full-sized avatar
🏀
lykmike

Stevie Huh stephenhuh

🏀
lykmike
View GitHub Profile
@stephenhuh
stephenhuh / db.js
Created October 7, 2018 06:41
scratch
basicSelect = () => {
return knex('workouts')
.select('*')
}
basicFilter = (knex) => {
return knex
.where('workout_id', 1)
}
function decorateRBAC(fn) {
console.log('----start decorate-----');
console.log(...arguments);
console.log('fn-name:', fn.name);
console.log('----end-----');
return fn;
}
function withValidation(fn) {
const handlerName = fn.name;
@stephenhuh
stephenhuh / Counter.js
Created June 6, 2024 01:29 — forked from tannerlinsley/Counter.js
Global React State with Context and Immer
import { useCount, useIncrement, useDecrement } from './store.Count'
export default function Counter () {
const count = useCount()
const increment = useIncrement()
const decrement = useDecrement()
return (
<div>
<div>Count: {count}</div>