Skip to content

Instantly share code, notes, and snippets.

View luong-komorebi's full-sized avatar
🐝
I may be slow to respond.

Luong Vo luong-komorebi

🐝
I may be slow to respond.
View GitHub Profile
" Highlight currently open file in nerdtree
" see http://superuser.com/a/474298/175466
" see http://superuser.com/a/509721/175466
" returns true iff is NERDTree open/active
function! rc:isNTOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
" returns true iff focused window is NERDTree window
@BrandonSmith
BrandonSmith / AndroidManifest.xml
Last active July 19, 2023 19:11
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@tomhodgins
tomhodgins / snippets.md
Last active August 8, 2022 14:27
Snippets.md is my most often used HTML, CSS and JavaScript snippets for front-end web development
@odigity
odigity / sequel_scopes.rb
Last active April 19, 2024 14:13
The Sequel Gem: Everything About Scopes
# (I recommend understanding the basics of this first: http://sequel.jeremyevans.net/rdoc/files/doc/object_model_rdoc.html)
# Extending the underlying dataset (http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html#label-Extending+the+underlying+dataset)
# The recommended way to implement table-wide logic by defining methods on the dataset using dataset_module:
class Post < Sequel::Model
dataset_module do
def posts_with_few_comments
where{num_comments < 30}
@joepie91
joepie91 / vpn.md
Last active June 18, 2024 07:25
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@huytd
huytd / .gitconfig
Created August 4, 2016 16:26
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@luong-komorebi
luong-komorebi / gmail.md
Last active December 17, 2016 17:04
Cách dùng gmail làm trung gian để gửi mail @tencongty.com

Hướng dẫn thiết lập gmail cho chúng ta

Gmail có đặc điểm là có giao diện dễ xài, quen thuộc với số đông người dùng. Tuy nhiên, vì chi phí lớn ($5/ người) cho email doanh nghiệp với đuôi @tencongty.com nên hiện tại brandartist của chúng ta phải thuê một thùng mail khác rẻ hơn. Các thùng mail bên ngoài thì không có giao diện như Gmail mà sẽ có giao diện riêng, dẫn đến một số khó khăn trong việc tương tác của người dùng bình thường.

Do đó, nhu cầu sản sinh cần thiết là làm sao dùng giao diện gmail, nhưng lại gửinhận được mail của công ty. ( Hay nói cách khác là biến gmail thành hộp thư trung gian )

Gửi

  • Bước 1: truy cập setting của gmail.
@reachlin
reachlin / prometheus.yml
Created April 19, 2017 07:06
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace