Skip to content

Instantly share code, notes, and snippets.

View wdjunaidi's full-sized avatar

Wirianto Djunaidi wdjunaidi

  • FarmIQ Systems, Ltd.
  • Wellington, New Zealand
  • X @wdjunaidi
View GitHub Profile
@wdjunaidi
wdjunaidi / gist:4b861f71635416b556f578e480cc7548
Created June 22, 2018 02:13
Getting count of unique npm dependencies
npm list | awk '{print $NF}' | sort | uniq | wc -l
@wdjunaidi
wdjunaidi / async_await.js
Created September 24, 2017 18:52
Playing with JavaScript async await behaviour
async function one() {
return 1;
}
const onePromise = one();
console.log(`one: ${onePromise}`);
onePromise.then(data => console.log(`one data: ${data}`));
async function nothing() {
console.log('in nothing');
@wdjunaidi
wdjunaidi / gist:7e15ef3f7963c965141e
Created May 26, 2015 03:28
Grab first word in commits between two ranges to extract defect number
git log --pretty=tformat:%s <commit>..<commit> | cut -f1 -d' ' | cut -f1 -d':' | sort | uniq
@wdjunaidi
wdjunaidi / gist:2092854
Created March 19, 2012 03:21
Vim search replace of IBM Portal wklpc_dbdomain.properties
# Replace all non commented DbType entries with new <DBTYPE>
:%s/^\([^#].*\.DbType\)=.*/\1=<DBTYPE>/
# Replace all non commented DbName entries with new <DBNAME>
:%s/^\([^#].*\.DbName\)=.*/\1=<DBNAME>/
# Replace all non commented DbSchema entry with WPSD_<UPPERCASE_DATABASE>
:%s/^\([^#].*\)\.DbSchema=.*/\1.DbSchema=WPSD_\U\1/
# Replace all non commented DataSourceName entry with wpsdDS_<database>
@wdjunaidi
wdjunaidi / gist:1887309
Created February 22, 2012 21:13
Finding PK name in Sybase
select i.name
from sysindexes i, sysobjects o
where o.name = @table_name
where i.id = o.id
and i.status2 != 0
and i.status2 != 512
@wdjunaidi
wdjunaidi / gist:1887281
Created February 22, 2012 21:08
Finding primary key name on Sybase
select i.name
from sysindexes i, sysobjects o
where o.name = @table_name
and i.id = o.id
and i.status2 != 0
and i.status2 != 512
@wdjunaidi
wdjunaidi / gist:1762114
Created February 7, 2012 21:27
curl - passing arrays and file as multipart/form-data
curl -vX POST <url> -F <arraykey>[0]=<value0> -F <arraykey>[1]=<value1> -F <arraykey>[2]=<value2> -F <key>=@<filename>
@wdjunaidi
wdjunaidi / gist:1679401
Created January 25, 2012 22:49
Simple git log that show all commit history
git log --pretty=format:'%h : %s' --graph --all