Skip to content

Instantly share code, notes, and snippets.

View linhmtran168's full-sized avatar
🦖

Linh M. Tran linhmtran168

🦖
View GitHub Profile
@linhmtran168
linhmtran168 / Redash-v2.md
Created October 1, 2018 03:32 — forked from nihonzaru/Redash-v2.md
Setup Redash v2.x for Oracle

Usage

Refs

https://redash.io/

Download Redash

$ curl -L -O https://github.com/getredash/redash/archive/v2.0.0.zip
@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 / 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 / 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 / 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
@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.

@linhmtran168
linhmtran168 / javascript_loader.js
Created March 29, 2016 09:36 — forked from hagenburger/javascript_loader.js
Dynamically load JavaScript files with callback when finished
// Example:
JavaScript.load("/javascripts/something.js");
// With callback (that’s the good thing):
JavaScript.load("http://www.someawesomedomain.com/api.js", function() {
API.use(); // or whatever api.js provides ...
});
@linhmtran168
linhmtran168 / parser.awk
Created February 19, 2016 03:00
Awk to parse mecab result
BEGIN {
first_line=1;
idx=1;
max_words=100;
}
{
if (index($4,"名詞") == 1)
if (first_line == 1) {
printf "%s", toupper($1);
@linhmtran168
linhmtran168 / FizzBuzz.scala
Created January 22, 2016 20:35
FizzBuzz Scala
import java.io.IOException
import java.nio.file.{FileAlreadyExistsException, Files, Paths}
import scala.math.BigInt
/**
* Created by linhmtran on 1/23/16.
*/
object FizzBuzz extends App {
try {