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 / 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>
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 / db.js
Created October 7, 2018 06:41
scratch
basicSelect = () => {
return knex('workouts')
.select('*')
}
basicFilter = (knex) => {
return knex
.where('workout_id', 1)
}
@stephenhuh
stephenhuh / lightsail.sh
Last active June 20, 2018 04:25
Setting up Amazon Linux AMI via Lightsail for Node & Express
#!/bin/bash
# Amazon_Linux-512MB-Virginia-1-Personal
# 512 MB RAM, 1 vCPU, 20 GB SSD
# Amazon Linux
# Virginia, Zone A (us-east-1a)
# Exit on any error (non-zero return code)
set -e
# Below commands are easier to run via root.
@stephenhuh
stephenhuh / index.jade
Created September 8, 2016 23:14
Stylist Desktop Landing
body#bootstrap-overrides
header#layout-header
a(href="http://www.threadgenius.co", target="_blank")
img(src="https://s3.amazonaws.com/threadgenius-web-assets/icon-small.png").logo
//TODO - add sidebar as needed for extensibility
//TODO - extract main into a section if parallax is going to be sought after
main#layout-main.container
//TODO make text slightly longer by expanding container or widening col
.row
h5.col-xs-8.col-xs-offset-4.blurb
@stephenhuh
stephenhuh / Dynamic SASS Header Sizing.markdown
Last active July 23, 2016 14:05
Dynamic SASS Header Sizing