Skip to content

Instantly share code, notes, and snippets.

View stephenhuh's full-sized avatar
🏀
lykmike

Stevie Huh stephenhuh

🏀
lykmike
View GitHub Profile
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)

Pitchfork’s Product team is hiring. We're looking for a sharp, creative front-end developer excited about pushing hard on UI and UX across all platforms. Your work will be seen daily by millions around the world, and you'll be a part of a small team of designers and developers whose work has been praised for redefining online music journalism and influencing the medium itself.

Our work environment is fast-paced and intimate: we all work very closely, and everyone has say in new ideas, features, and approach. You should be someone constantly learning about new technology and keenly aware of its practical applications and limitations. It should go without saying that you’re willing to take on any task, regardless of size or glory. Everyone here wears many hats, and no job is too small for anyone. Strong communication skills are a must, as is the desire to teach as much as you learn. A love for music doesn’t hurt, either.

Responsibilities

As part of Pitchfork’s Product team, you will help us

  • consistent
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@stephenhuh
stephenhuh / gist:fafcb63be4b447a3b170
Last active August 29, 2015 14:25 — forked from zjrosen1/livecodingstats.js
LiveCoding Stats
// ==UserScript==
// @name LiveCoding Stats
// @namespace http://your.homepage/
// @version 0.1
// @description Shows your channel stats (live viewers, total viewers) in the chat window
// @author Fabian Becker <[email protected]>
// @match https://www.livecoding.tv/chat/*
// @grant none
// ==/UserScript==
@zjrosen1
zjrosen1 / .tmux.conf
Last active May 16, 2016 15:56
Tmux Configuration
# | |_ _ __ ___ _ ___ __ #
# | __| '_ ` _ \| | | \ \/ / #
# | |_| | | | | | |_| |> < #
# \__|_| |_| |_|\__,_/_/\_\ #
# 1 0 | VIM | 2:bash 20:04
# [ Reset Prefix ] {{{1
set -g prefix C-a
bind-key a send-prefix # for nested tmux sessions
@chantastic
chantastic / on-jsx.markdown
Last active November 10, 2024 13:39
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@brianmacarthur
brianmacarthur / flash-app.js
Last active March 19, 2025 14:21
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines
@makmanalp
makmanalp / comparison.md
Last active June 10, 2024 14:24
Angular vs Backbone vs React vs Ember notes

Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.

My top contenders, mostly based on popularity / community etc:

  • Angular
  • Backbone
  • React
  • Ember

Mostly about MVC (or derivatives, MVP / MVVM).

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@tracker1
tracker1 / 01-directory-structure.md
Last active March 4, 2025 21:23
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used