Skip to content

Instantly share code, notes, and snippets.

View linhmtran168's full-sized avatar
🦖

Linh M. Tran linhmtran168

🦖
View GitHub Profile
@linhmtran168
linhmtran168 / .tmux.conf
Created May 22, 2019 10:09
WSL dotfiles
# Command prefix (like screen)
unbind C-b
set -g prefix C-a
bind-key a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# basic settings
@linhmtran168
linhmtran168 / test.go
Created April 8, 2019 10:37
Pongo2 filter using reflect
// TrueCondition implement IConditionCheckable interface
func (test *TestStruct) TrueCondition() bool {
if test.IsTrue {
return true
}
return false
}
@linhmtran168
linhmtran168 / zcom-vars-compiled.js
Created July 23, 2018 13:01
Sample final output file
(function(exports) {
exports.CNS_ADDRESS = "0xdummy99999999999999999999999999999999";
exports.HISTORY_ADDRESS = "0xdummy99999999999999999999999999999999";
exports.HISTORY_ABI = [{"constant":true,"inputs":[],"name":"organizations","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"nonces","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"histories","outputs":[{"name":"isCreated","type":"bool"},{"name":"allowGroupId","type":"bytes32"},{"name":"userDataObjectId","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gmoCns","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_gmoCns","type":"address"},{"name":"_organizations","type":"address"}]
@linhmtran168
linhmtran168 / settings.json
Last active June 25, 2018 09:57
vs code Windows setting
{
"workbench.iconTheme": "eq-material-theme-icons",
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"terminal.integrated.shellArgs.windows": ["/K", "C:\\tools\\cmder\\vscode.bat"],
"vim.easymotion": true,
"vim.incsearch": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.sneak": true,
"vim.leader": "<space>",
@linhmtran168
linhmtran168 / vscode.bat
Created March 20, 2018 13:18
Script for use cmder as terminal in VSCODE
@echo off
SET CurrentWorkingDirectory=%CD%
SET CMDER_ROOT=C:\tools\cmder
CALL "%CMDER_ROOT%\vendor\init.bat"
CD /D %CurrentWorkingDirectory%
@linhmtran168
linhmtran168 / parity_install.sh
Created February 22, 2018 10:16
Parity install script
RELEASE="stable"
ARCH=$(uname -m)
VANITY_SERVICE_URL="https://vanity-service.parity.io/parity-binaries?architecture=$ARCH&format=markdown"
LIBSSL="undef"
check_os() {
if [ "$(uname)" = "Linux" ] ; then
PKG=linux # linux is my default
@linhmtran168
linhmtran168 / .eslintrc.json
Created January 19, 2018 09:40
Eslint config
{
"env": {
"es6": true,
"node": true
},
"extends": "standard",
"rules": {
"indent": [
"error",
4
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@linhmtran168
linhmtran168 / vietnamese.rules
Created March 23, 2015 15:41
Vietnamese unaccent rules
À A
Á A
Ả A
Ạ A
 A
Ấ A
Ầ A
Ẩ A
Ậ A
Ẫ A
@linhmtran168
linhmtran168 / gist:2ec35dc3a78e3538fe58e97810aa1586
Created May 19, 2016 08:15 — forked from nim23/gist:d1c6852c37a3b3329677
IScroll 5 with DOM change detection

IScroll 5 with DOM change detection

When implementing a custom scrollbars there’s a need to detect changes in height of the element to which you are applying the scrollbars to, as the height of the scrollbars need to be adjusted based on the content’s height. We also need to take into account that the content could change and height needs to be recalculated i.e paging on queries could yield 10 results, whilst on the last page it could yield just 5 results, and these changes need to be accounted for by the scrollbar. And the same problem arises when getting content asynchronously, because whilst the content is empty on initial render it gets rendered only after successful fetch of the required data and we should calculate the scrollbar height once the content is available which is hard to determine as the operation is asynchornous.

Different libraries and plugins deal with the problem separately.