Skip to content

Instantly share code, notes, and snippets.

View longkt90's full-sized avatar

Long Nguyen longkt90

  • Singapore
View GitHub Profile
@longkt90
longkt90 / webuild-til.txt
Created May 10, 2022 03:35 — forked from huytd/webuild-til.txt
Every #til entries of WeBuild since 2016
This file has been truncated, but you can view the full file.
[5/5/2016, 1:52:07 AM] [alias Trung.Le, as tle]: #elixirlang <http://kipalog.com/posts/Chen-doi-tuong-vao-mot-List-theo-chieu-nguoc-voi-ham-List-insert_at-va-index-am>
[5/15/2016, 4:51:25 AM] []: #til: Maybe Just Nothing
[5/15/2016, 4:20:09 PM] [alias Trung.Le, as tle]: *TIL* technology does not only solve biz problems but also social and political problems too. Use it wisely for the good
[5/17/2016, 8:25:18 PM] [alias Trung.Le, as tle]: *TIL* JSON Octet là gì - <http://stackoverflow.com/questions/7200554/what-is-a-json-octet-and-why-are-two-required>
[5/17/2016, 8:31:39 PM] []: #til - Bỏ bữa khiến bạn béo bụng, ăn đủ bữa bằng các loại thức ăn có lợi cho sức khỏe là con đường đúng đắn nhất giúp bạn giảm cân thành công. :parrot:
[5/17/2016, 8:34:01 PM] []: #til Muốn hiểu vì sao, hãy tự đi tìm câu trả lời bằng cái mình tự khám phá là chính xác nhất. Chỉ nghe là không đủ.
[5/17/2016, 11:52:54 PM] [alias Trung.Le, as tle]: *TIL* sprocket trong Rails 3 khi khai báo manifest thì bạn không cần phải khai báo đầy đủ

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@longkt90
longkt90 / ways_to_use_vcr.rb
Created April 14, 2019 10:42 — forked from myronmarston/ways_to_use_vcr.rb
Ways to use VCR for a request made by a let block
# 1) Use VCR.use_cassette in your let block. This will use
# the cassette just for requests made by creating bar, not
# for anything else in your test.
let(:foo) { VCR.use_cassette("foo") { create(:bar) } }
it "uses foo" do
foo
end
# 2) Wrap the it block that uses #foo in VCR.use_cassette.
@longkt90
longkt90 / GPG and git on macOS.md
Created November 2, 2018 04:28 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@longkt90
longkt90 / vim-heroku.sh
Created May 2, 2018 06:08 — forked from dvdbng/vim-heroku.sh
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@longkt90
longkt90 / balances.rb
Last active September 20, 2017 16:28
Bittrex view your balances
require 'rubygems'
require 'bittrex' # gem install bittrex
require 'terminal-notifier' # gem install terminal-notifier
require 'json'
Bittrex.config do |c|
c.key = 'readonly-key'
c.secret = 'readonly-secret'
end
@longkt90
longkt90 / config.ctmpl
Created October 20, 2016 02:22
Example Chef recipe to install Consul Template
{{
# /opt/my-app/consul.ctmpl
#
# This file is read by Consul Template and rendered onto disk using
# the configuration placed in /etc/consul-template.d.
}}
{{ with vault "postgresql/creds/readonly" }}
[config]
username = "{{ .Data.username }}"
@longkt90
longkt90 / install-comodo-ssl-cert-for-nginx.rst
Created August 22, 2016 09:33 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@longkt90
longkt90 / gpg-import-and-export-instructions.md
Created July 27, 2016 03:49 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@longkt90
longkt90 / rdrc2016.md
Created July 7, 2016 04:39 — forked from cheeaun/rdrc2016.md
RedDotRubyConf 2016 links & resources 😘