Skip to content

Instantly share code, notes, and snippets.

@imjching
imjching / Docker Notes.txt
Created March 2, 2016 11:32 — forked from MrSaints/Docker Notes.txt
Notes on initiating a Docker Machine; killing Docker processes; cleaning Docker containers, and images; and building / running / executing with Docker. Docker, Docker, Docker...
docker-start() {
docker-machine start ${1:-dev}
eval "$(docker-machine env ${1:-dev})"
export DOCKER_IP=$(docker-machine ip ${1:-dev})
echo The machine ip is DOCKER_IP=$DOCKER_IP
}
docker-kill() {
docker-compose kill
docker stop $(docker ps -a -q)
@imjching
imjching / Dockerfile
Created March 4, 2016 07:10
Utilizing Docker's caching system
# Choose the official Ruby 2.3.0 image as our starting point
FROM ruby:2.3.0
# Run updates for nokogiri and JS runtime
RUN apt-get update -qq && apt-get install -y build-essential libxml2-dev libxslt1-dev nodejs
# Cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set up working directory
@imjching
imjching / Dockerfile
Created March 4, 2016 07:23
Utilizing Docker's data-only container
# Choose the official Ruby 2.3.0 image as our starting point
FROM ruby:2.3.0
# Run updates for nokogiri and JS runtime
RUN apt-get update -qq && apt-get install -y build-essential libxml2-dev libxslt1-dev nodejs
# Cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set up working directory

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@imjching
imjching / SQLite.g4
Created February 17, 2017 16:33
SQL Grammar for ANTLR4
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 by Bart Kiers
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
@imjching
imjching / TestLexer.java
Created February 17, 2017 16:35
TestLexer.java
import java.io.File;
import java.io.FileInputStream;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.Token;
public class TestLexer {
public static void main(String[] args) throws Exception {
System.out.println("Parsing: " + args[0]);
@imjching
imjching / ScriptLexer.g4
Created February 17, 2017 16:36
ScriptLexer.g4
// Name our lexer (the name must match the filename)
lexer grammar ScriptLexer;
// Define string values - either unquoted or quoted
STRING : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'@')+ |
('"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\'))* '"') ;
// Skip all spaces, tabs, newlines
WS : [ \t\r\n]+ -> skip ;
@imjching
imjching / sample.script
Created February 17, 2017 16:36
sample.script
// What to do in the morning
func morning <
name := "Jay";
greet morning=true input=@name;
eat cereals;
attend class="CS101";
>
// What to do at night
func night <
@imjching
imjching / output_deployments.txt
Created August 21, 2017 03:43
Production Engineering / Infrastructure Problem
Name: db
Namespace: shopify-dev
CreationTimestamp: Sun, 20 Aug 2017 15:41:35 -0700
Labels: app=db
Annotations: deployment.kubernetes.io/revision=1
Selector: app=db
Replicas: 1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 1 max unavailable, 1 max surge
@imjching
imjching / README.md
Created March 3, 2018 21:11 — forked from hofmannsven/README.md
My simply Git Cheatsheet