Skip to content

Instantly share code, notes, and snippets.

View kojinkai's full-sized avatar
🎯
Focusing

Lewis Nixon kojinkai

🎯
Focusing
View GitHub Profile
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="ys"
# Example aliases
alias l="ls -la"
alias gs='git status '
alias gst='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias got='git '
alias get='git '
@kojinkai
kojinkai / .gitconfig
Created April 30, 2014 16:58
My .gitconfig file
[alias]
co = checkout
ci = commit
ca = commit -a
st = status
s = status
br = branch
ps = push
pl = pull
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
@kojinkai
kojinkai / formsy_validation_pipeline.js
Last active September 22, 2017 16:12
A higher order validation pipeline function for combining validation rules into a pipeline
const createValidationPipeLine = filters
=> (values, value, otherField)
=> filters.reduce((currentValue, filter)
=> filter(values, value, otherField), value);
import React from 'react';
import { shallow, mount } from 'enzyme';
import { shallowWithIntl, mountWithIntl } from './react-intl';
const componentWrapper = renderer => (Component, defaultProps) => props => renderer(
<Component
{...defaultProps}
{...props}
/>,
using UnityEngine;
public class SoundTrackController : MonoBehaviour
{
private void Awake()
{
// We want this soundTrackController to persist across every scene (singleton)
// so we check if there is an existing instance and reuse that, destroying the attempted new
// instance in the process.
// GetType returns the type of the current gameobject the script is attached to

New Branch

Rationale

A small command line tool for creating and naming new topic branches in a consistent way.

Installation

create a new-branch script in a folder somewhere in your path.

touch ~/path/to/your/folder/new-branch
@kojinkai
kojinkai / README.md
Last active June 18, 2019 15:22
A small shell script to run after closing a Pull Request

Branch Cleanup

Rationale

When working on topic branches, you often have a many old branches clogging up your local and remote repositories. This small command line tool can be run immediatley after closing a Pull Request to prune away the topic branch both locally and remotely and then bring your target branch up to date automatically before starting your new topic branch. This keeps your git repo free from clutter and ensures you always begin new branches at the point of integration - at the head of your project's target branch.

Installation

Create a branch-cleanup script in a folder. This folder should be in your path for it to be executable from the CLI.

touch ~/path/to/your/folder/new-branch
@kojinkai
kojinkai / machine.js
Last active August 6, 2019 09:24
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@kojinkai
kojinkai / machine.js
Created August 7, 2019 09:25
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions