Skip to content

Instantly share code, notes, and snippets.

@ntsh
ntsh / JsonToArray-Stamps.js
Created January 17, 2017 20:31
Scripts to convert dashboard json data to array and csv
// Dependencies: Moment and Underscore
// Paste the output at https://konklone.io/json/ to get the csv data
var data = {"totalRedemptionsCount":301,"totalVisitCount":1457,"monthlyLogscount":24,"dailyLogscount":68,"totalStampsCount":1308,"dailylogrequired":true,"monthlyLogs":[{"redeemCount":19,"dailyData":{"sc":{"10":29,"19":3,"18":2,"16":2,"14":15},"vc":{"10":46,"19":3,"18":2,"16":3,"14":16},"rc":{"10":17,"16":1,"14":1}},"stampCount":51,"startDateTime":"2016-01-01T00:00:00.000Z","visitCount":70,"storeId":5206673425694720,"endDateTime":"2016-01-31T23:59:59.999Z"},{"redeemCount":0,"dailyData":{"sc":{},"vc":{},"rc":{}},"stampCount":0,"startDateTime":"2016-01-01T00:00:00.000Z","visitCount":0,"storeId":5765486922956800,"endDateTime":"2016-01-31T23:59:59.999Z"},{"redeemCount":20,"dailyData":{"sc":{"10":13,"0":3,"4":62,"17":1,"18":21,"15":16,"14":17,"27":9,"28":29,"12":4},"vc":{"10":13,"0":5,"4":71,"17":1,"18":16,"15":18,"14":15,"27":10,"28":26,"12":4},"rc":{"10":1,"0":2,"4":9,"18":1,"15":2,"14":2,"27":1,"28":2}},"s
@ntsh
ntsh / git-log-pretty
Created February 1, 2022 10:25
Git config
alias.lg=log --graph --abbrev-commit --decorate --date=short --format=format:'%C(bold blue)%h %C(reset) %C(auto)%s%C(reset) %C(reset) %C(bold green)%ad%C(reset) %C(auto)%d<%an>'