Skip to content

Instantly share code, notes, and snippets.

@LukaHuang
LukaHuang / Tennis.js
Created August 21, 2019 16:02 — forked from RaphaHsu/Tennis.js
jest: tennis game kata
class Player {
constructor(name) {
this.name = name;
this.score = 0;
}
}
module.exports = class User {
constructor(firstPlayerName, secondPlayerName) {
this.firstPlayer = new Player(firstPlayerName);
@LukaHuang
LukaHuang / aws_signed_request_v4.rb
Created August 15, 2019 12:13 — forked from blelump/aws_signed_request_v4.rb
Sample Ruby code to create AWS signed request version 4 (with request headers)
#Signing AWS Requests By Using Signature Version 4
#http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
require 'uri'
require 'openssl'
require 'net/http'
require 'cgi'
method = 'GET'
service = 'iam'
@LukaHuang
LukaHuang / postgres-brew.md
Created August 8, 2019 11:01 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@LukaHuang
LukaHuang / list-categories-count.liquid
Created January 8, 2019 13:12 — forked from Phlow/list-categories-count.liquid
Jekyll: List all categories with according post count and show and link all post items listed in the according category
<h2>Categories</h2>
<ul>
{% assign categories_list = site.categories %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="#{{ category | downcase | downcase | url_escape | strip | replace: ' ', '-' }}">{{ category | camelcase }} ({{ site.tags[category].size }})</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="#{{ category[0] | downcase | url_escape | strip | replace: ' ', '-' }}">{{ category[0] | camelcase }} ({{ category[1].size }})</a></li>
@LukaHuang
LukaHuang / gist:977455f5bd5a6c29ecf88e69be6b0097
Created August 15, 2018 13:04 — forked from jrochkind/gist:59b6330e3f52710cc49e
Monkey patch to ActiveRecord to forbid
######################
#
# Monkey patch to ActiveRecord to prevent 'implicit' checkouts. Currently tested with Rails 4.0.8, prob
# should work fine in Rails 4.1 too.
#
# If you create a thread yourself, if it uses ActiveRecord objects without
# explicitly checking out a connection, one will still be checked out implicitly.
# If it is never checked back in with `ActiveRecord::Base.clear_active_connections!`,
# then it will be leaked.
#
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@LukaHuang
LukaHuang / docker-compose.yml
Created May 22, 2018 02:24 — forked from onjin/docker-compose.yml
example docker compose for postgresql with db init script
postgres:
image: postgres:9.4
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
@LukaHuang
LukaHuang / mac-apps.md
Created April 23, 2018 06:37 — forked from ankurk91/mac-apps.md
Mac OS Sierra Apps and configs

macOS Apps

Homebrew

xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@LukaHuang
LukaHuang / fish shell GitKraken config
Last active December 14, 2017 09:37
fish shell visual studio code config
function kk
open -a 'GitKraken' --args -p $PWD
end