Skip to content

Instantly share code, notes, and snippets.

View kimyu-ng's full-sized avatar
🎯
Focusing

Kim Yu Ng kimyu-ng

🎯
Focusing
View GitHub Profile
@kimyu-ng
kimyu-ng / config.yml
Created October 5, 2017 15:41
circleci 2.0 config.yml
version: 2
jobs:
build:
working_directory: /app
docker:
- image: smarthr/circleci-base
environment:
RAILS_ENV: test
DB_HOST: 127.0.0.1
@kimyu-ng
kimyu-ng / Gemfile
Created August 8, 2017 20:53 — forked from nateberkopec/Gemfile
ActionCable isn't *really* a Rails 5 dependency.
# gem 'rails'
gem "activerecord"
gem "actionpack"
gem "actionview"
gem "actionmailer"
gem "activejob"
gem "activesupport"
gem "railties"
gem "sprockets-rails"
gem 'sqlite3'

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@kimyu-ng
kimyu-ng / iterm2-solarized.md
Created April 26, 2017 19:10 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@kimyu-ng
kimyu-ng / Java.md
Created September 23, 2016 20:04 — forked from JeOam/Java.md
Install Java 8 on OS X

on El Capitan, after installing the brew...

$ brew update
$ brew tap caskroom/cask
$ brew install Caskroom/cask/java

And Java 8 will be installed at /Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/

Check version:

@kimyu-ng
kimyu-ng / query_planner.markdown
Created September 13, 2016 16:16 — forked from hgmnz/query_planner.markdown
PostgreSQL query plan and SQL performance notes

Types of index scans

Indexes

Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.
@kimyu-ng
kimyu-ng / simple-linear-regression.rb
Created August 17, 2016 17:50 — forked from rweald/simple-linear-regression.rb
Simple Linear Regression in Ruby
class SimpleLinearRegression
def initialize(xs, ys)
@xs, @ys = xs, ys
if @xs.length != @ys.length
raise "Unbalanced data. xs need to be same length as ys"
end
end
def y_intercept
mean(@ys) - (slope * mean(@xs))