Skip to content

Instantly share code, notes, and snippets.

==== initialDP ====
{
"header": {
"clgt": "60121234567"
"otid": "123456778",
"cdgt": "60121234567"
"dtid": "123456778",
"app-ctx": "123456778",
"tc-type": 62(begin)/65(continue)/64(end)
},
@thiamteck
thiamteck / 0_reuse_code.js
Created January 5, 2016 04:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@thiamteck
thiamteck / remove_namespace_from_xml.sh
Created April 6, 2017 03:06
Remove default namespace declaration from pom.xml
#
# Reference : http://stackoverflow.com/a/16700113/90101
#
#
# remove default namespace declaration
#
sed -e 's/ xmlns=".*"//g' pom.xml
#
@thiamteck
thiamteck / LogViewer.py
Created November 15, 2017 02:20
A more readable view for capture file of Selenium SMPPSim
import datetime
import fileinput
import shlex
##
# Usage: tail -f *.capture | python LogViewer.py
##
def construct_dictionary(line):
# ref: https://stackoverflow.com/a/38787616/90101
@thiamteck
thiamteck / svn_gitignore.sh
Created December 18, 2017 02:16
read .gitignore file and ignore the entries via svn:ignore
svn propset svn:ignore -RF .gitignore .
@thiamteck
thiamteck / server.py
Created June 26, 2018 17:04
server.py from deoplete-jedi
"""Jedi mini server for deoplete-jedi
This script allows Jedi to run using the Python interpreter that is found in
the user's environment instead of the one Neovim is using.
Jedi seems to accumulate latency with each completion. To deal with this, the
server is restarted after 50 completions. This threshold is relatively high
considering that deoplete-jedi caches completion results. These combined
should make deoplete-jedi's completions pretty fast and responsive.
"""
@thiamteck
thiamteck / random_datetime_between.sql
Created November 19, 2018 11:50
MySQL function for get random datetime in between 2 given datetime. Copy from : https://stackoverflow.com/a/49727273
DELIMITER $$
DROP FUNCTION IF EXISTS `random_datetime_between`$$
CREATE FUNCTION `random_datetime_between`(date_from DATETIME, date_to DATETIME) RETURNS DATETIME
BEGIN
/**
* reference: https://stackoverflow.com/a/49727273
*/
DECLARE result DATETIME;
@thiamteck
thiamteck / range_overlap_check.html
Last active November 22, 2018 02:04
Check if number range is overlapping. JS Bin// source https://jsbin.com/poyacef
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';
FLUSH PRIVILEGES;
#
# Based on custom settings by Bruce Dodson, http://gisdeveloper.tripod.com/scite.html
# Does not support `start.in.monospaced.mode`, but invert the font setting among monospace and non-monospace font in order to start SciTE with monospace font
#
tabbar.hide.one=1
tabbar.multiline=1
toolbar.visible=1
statusbar.visible=1