Skip to content

Instantly share code, notes, and snippets.

@tieubao
tieubao / xcode-build-bump.sh
Created November 14, 2016 17:03 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@tieubao
tieubao / codeship-elixir.sh
Created July 7, 2016 10:39 — forked from paulgoetze/codeship-elixir.sh
Codeship Elixir/Phoenix test setup
#!/bin/bash
# Erlang
ERLANG_VERSION=${ERLANG_VERSION:-19.0}
ERLANG_CACHED_DOWNLOAD="${HOME}/cache/OTP-${ERLANG_VERSION}.tar.gz"
ERLANG_DIR=${ERLANG_DIR:="$HOME/erlang"}
# Elixir
ELIXIR_VERSION=${ELIXIR_VERSION:-1.3.1}
ELIXIR_CACHED_DOWNLOAD="${HOME}/cache/elixir-v${ELIXIR_VERSION}.zip"
@tieubao
tieubao / Procfile
Created July 5, 2016 12:10 — forked from mustafaturan/Procfile
Configurations for Phoenix Framework 'Deploy To Heroku' button
web: MIX_ENV=prod mix phoenix.server
@tieubao
tieubao / pull-request-template.md
Created March 6, 2016 20:06 — forked from Lordnibbler/pull-request-template.md
Sample Pull Request Template

Status

READY/IN DEVELOPMENT/HOLD

Migrations

YES | NO

Description

A few sentences describing the overall goals of the pull request's commits.

Related PRs

@tieubao
tieubao / cucumbertables.vim
Created February 3, 2016 12:10 — forked from MaienM/cucumbertables.vim
Auto-align on equal signs (=) using Tabularize.
inoremap <silent> = =<Esc>:call <SID>ealign()<CR>a
function! s:ealign()
let p = '^.*=\s.*$'
if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
Tabularize/=/l1
normal! 0
call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
endif
@tieubao
tieubao / ledis.md
Created December 6, 2015 16:50 — forked from minhnhdo/ledis.md

Update (10am)

  • RPUSH, SADD needs to support multiple values
  • Command names are case-insensitive, parameter and values are case-sensitive and must be all lowercase.
  • If a command doesn't specify return value, please return OK if successful, or follow the error code.
  • Updated sample tests (see link in the sample tests section)
  • SET will always overwrite the value for that key

Grokking Challenge Finale

@tieubao
tieubao / GoMgoSample-1.go
Last active August 29, 2015 14:27 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain

@tieubao
tieubao / yolo
Last active August 29, 2015 14:13 — forked from tagrudev/yolo
# Do not refactor, it is a bad practice. YOLO
# Not understanding why or how something works is always good. YOLO
# Do not ever test your code yourself, just ask. YOLO
# No one is going to read your code, at any point don't comment. YOLO
# Why do it the easy way when you can reinvent the wheel? Future-proofing is for pussies. YOLO