Skip to content

Instantly share code, notes, and snippets.

View thenormalsquid's full-sized avatar
I'm your huckleberry

Thien-Bach Huynh thenormalsquid

I'm your huckleberry
View GitHub Profile
@thenormalsquid
thenormalsquid / .zshrc
Last active July 19, 2020 18:37
My zsh configuration
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# load pure theme
fpath+=$HOME/.zsh/pure
autoload -U promptinit; promptinit
prompt pure
# Path to your oh-my-zsh installation.
export ZSH="/Users/thien-bach/.oh-my-zsh"

Functional specification

Purpose and guidelines

This template can be used by teams to help them think through the purpose, goals, and implications of product ideas and features. This should be seen as a living document and should therefore be edited in non-permanent locations such as Dropdbox Paper or Google Docs. These documents should be accessible and editable by the entire team.

Not all sections need to be filled out, and the entire document certainly won't be completed up front. As a living document, fill out what's applicable and available, and add/remove as you go.


@thenormalsquid
thenormalsquid / git-show-remote-branches.sh
Created March 20, 2019 17:35
Lists all remote branches and last commit date
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@thenormalsquid
thenormalsquid / javascriptreact.json
Created June 7, 2017 18:20
vscode react snippets
{
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
// @flow
import { createReducer, createHandlers, compose } from '_util/redux-utils';
import { createSelector } from 'reselect';
import { Set, Map } from 'immutable';
import {
ASYNC_GET_FULFILLMENTS,
SET_SELECTED_FULFILLMENT
} from '_constants';
@thenormalsquid
thenormalsquid / FulfillmentContainer.js
Created December 8, 2016 18:40
example usage of reselect
import React, { PropTypes } from 'react';
import { compose } from 'recompose';
import { withStyles, onMount, connect } from '_util/HOCs';
import { FlexBox } from '@madmobilenpm/mmui';
import AppView from 'view';
import { getGroupedFulfillments, getFulfillmentById } from '_redux/selectors';
import * as actions from 'actions/fulfillment';
import FulfillmentList from 'components/fulfillment/FulfillmentList';
import FulfillmentOrderHeader from 'components/fulfillment/FulfillmentOrderHeader';
import ProductList from 'components/fulfillment/ProductList';
@thenormalsquid
thenormalsquid / eyes.cs
Created October 16, 2016 18:03
eyes.cs
public class UpdateEyeAnchors : MonoBehaviour
{
GameObject[] eyes = new GameObject[2];
string[] eyeAnchorNames = { "LeftEyeAnchor", "RightEyeAnchor" };
void Update()
{
for (int i = 0; i < 2; ++i)
{
// If the eye anchor is no longer a child of us, don't use it
@thenormalsquid
thenormalsquid / pre-commit.sh
Created February 14, 2016 22:59
grunt jshint pre-commit hook
#!/bin/sh
# This pre-commit hook prevents lint errors from getting committed
# Requires jshint and grunt
jshintout=$(/usr/local/bin/grunt jshint)
exitcode=$?
files=$(git diff --cached --name-only --diff-filter=ACM | grep "\.js$")
if [ "$files" = "" ]; then
exit 0
fi
@thenormalsquid
thenormalsquid / invert_bin_tree.py
Created August 27, 2015 20:53
invert_bin_tree
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def swap_nodes(self, node):
tmp = node.right
var CommentBox = React.createClass({
render: function() {
return (
<div className="commentBox">
<h1>Comments</h1>
<CommentList data={this.props.data} />
<CommentForm />
</div>
);
}