Skip to content

Instantly share code, notes, and snippets.

JSON.parse

Ryan Wuster ryanhanwu

JSON.parse
View GitHub Profile
@ryanhanwu
ryanhanwu / Makefile
Created May 5, 2020 — forked from jonschlinkert/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
View Makefile
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
View programming-quotes.md
@ryanhanwu
ryanhanwu / the-scratch.conf
Created May 4, 2018 — forked from korczis/the-scratch.conf
Nginx Node.js Proxy with caching, websockets, gzip
View the-scratch.conf
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=cache:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_the_scratch {
server 127.0.0.1:3000 weight=1 fail_timeout=60s;
}
# the nginx server instance
server {
@ryanhanwu
ryanhanwu / The Technical Interview Cheat Sheet.md
Created Jan 29, 2017 — forked from TSiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ryanhanwu
ryanhanwu / gist:8a8013c1f3d65a178dc5bb070e3b8c0b
Created May 10, 2016 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
View gist:8a8013c1f3d65a178dc5bb070e3b8c0b

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@ryanhanwu
ryanhanwu / gist:e99fe81156e5eede72d909b71a33addb
Created May 9, 2016 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
View gist:e99fe81156e5eede72d909b71a33addb
git fetch --all
git reset --hard origin/master
git pull origin master
@ryanhanwu
ryanhanwu / git-aliases.md
Created Mar 21, 2016 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup
View git-aliases.md

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@ryanhanwu
ryanhanwu / npm-upgrade-bleeding.sh
Last active Aug 29, 2015 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
View npm-upgrade-bleeding.sh
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@ryanhanwu
ryanhanwu / agg.coffee
Last active Aug 29, 2015 — forked from lawrencejones/agg.coffee
Projection generator for mongodb
View agg.coffee
_ = require 'underscore'
# Given an array of elements ELEM and a matching KEY value,
# will build the apprpriate projection to generate sortable
# weights for a mongo aggregator.
#
# ELEM: An array of values upon which to match against KEY
# KEY: The document field key to match against
# I: Default 0, index into array at which to begin
#
You can’t perform that action at this time.