Skip to content

Instantly share code, notes, and snippets.

View 0xRichardH's full-sized avatar
🍉

Richard Hao 0xRichardH

🍉
View GitHub Profile
@0xRichardH
0xRichardH / canggu.geojson
Created December 10, 2020 01:52 — forked from levelsio/canggu.geojson
canggu.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0xRichardH
0xRichardH / Gemfile
Created June 24, 2020 23:30 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@0xRichardH
0xRichardH / postgres-cheatsheet.md
Created October 4, 2018 03:47 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@0xRichardH
0xRichardH / docker-cleanup-resources.md
Created August 24, 2018 23:21 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@0xRichardH
0xRichardH / pre-commit.sh
Created August 22, 2018 08:58 — forked from alexbevi/pre-commit.sh
Git pre-commit hook that checks ruby source files for Pry breakpoints
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files
# for Pry binding references
#
# Installation
#
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit
#
# Based on
#
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/
@0xRichardH
0xRichardH / iterm2-solarized.md
Created February 14, 2018 09:16 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@0xRichardH
0xRichardH / Crypto.ex
Created October 17, 2017 03:10 — forked from 10nin/Crypto.ex
Get MD5 message digest by elixir-lang.
defmodule Crypto do
def md5(s) do
list_to_binary(Enum.map(bitstring_to_list(:crypto.md5(s)), fn(x) -> integer_to_binary(x, 16) end))
end
end