Skip to content

Instantly share code, notes, and snippets.

View thevuuranusls's full-sized avatar

Nguyễn Vũ thevuuranusls

View GitHub Profile
0vN89keyJdSIwb5o4Uza6u Verano Forever
5DzZYwKoh9ozTdQwKYBq1g Hits FMR
0PoIfHWWyOlaUiasya0fh4 Hits Rock
5j1RaA5EIamo9rIZQ7uO1a Chanson Française : L'essentiel
5EflpspUG8t2jAGBePd9aK Le ménage en musique
7b9XqnXw5J47tmn0Y0IZeW Chill Hits
7gjTRaVp9UP2wpWewzvAYS Chilliger House
2vJPOFapYKv9AAdDgyjVRr Chillout Lounge
6iRDTaQ5IVfRStez7FWwke Chill Mode: On
65p90fEsFYGyT3zU5ELmCh CHILL OUT
------- COOL POP - VIBEY JAMS -------
Betty Who
The Chainsmokers
Halsey
Kygo
Conrad Sewell
Daya
Sia
HAIM
Adele
@thevuuranusls
thevuuranusls / gist:4b42814df649889624b96fb13769c5bc
Created March 12, 2017 14:17 — forked from THemming/gist:2173037
init.d script to launch Play framework under CentOS/RedHat
#!/bin/bash
# chkconfig: 345 20 80
# description: Play start/shutdown script
# processname: play
#
# Instalation:
# copy file to /etc/init.d
# chmod +x /etc/init.d/play
# chkconfig --add /etc/init.d/play
# chkconfig play on
@thevuuranusls
thevuuranusls / difference.js
Created January 19, 2018 11:20 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
@thevuuranusls
thevuuranusls / latency.txt
Created May 30, 2019 17:07 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@thevuuranusls
thevuuranusls / db_test.go
Created September 14, 2019 04:54 — forked from void-main/db_test.go
Test Beego ORM with mocked sql driver
package db
import (
"testing"
"github.com/astaxie/beego/logs"
"github.com/astaxie/beego/orm"
"time"
This file has been truncated, but you can view the full file.
{
"roomTypeFacilityFeed": {
"roomTypeFacilities": {
"roomTypeFacility": [
{
"hotelId": 10979,
"hotelRoomTypeId": 78145779,
"propertyId": 30,
"propertyName": "Hair dryer",
"translatedName": "Máy sấy tóc"
EVNCPC EVN Miền Trung ACTIVE ^PC03.*,^PC06.*,^PP.* 2
Update
EVNHN EVN Hà Nội MAINTENANCE 2
Update
EVNNPC EVN Miền Bắc ACTIVE ^PH.*,^PA19.*,^PA01.*,^PA12.*,^PA11.* 2
Update
EVNSG EVN Hồ Chí Minh ACTIVE 2
Update
EVNSPC EVN Miền Nam ACTIVE ^PB14.*,^PB10.* 2
Update
{"STEP_1":"h.AutoPayment","STEP_2":"getListCPSAgreementWithStatus","STEP_3":"h.QueryBill","Time":"2020-12-30T12:00:05+07:00","level":"info","msg":"done","queryBillResp":"{\"returnCode\":1,\"returnMessage\":\"Giao dịch thành công.\",\"data\":{\"appid\":821,\"supplierid\":701,\"customercode\":\"1500020009502248\",\"totalamount\":34009468,\"paymentrule\":2,\"billlist\":[{\"appid\":821,\"customercode\":\"1500020009502248\",\"supplierid\":701,\"month\":202101,\"monthstr\":\"01/2021\",\"billid\":\"1500020009502248:1:2021\",\"billtype\":1,\"amount\":34009468,\"querydate\":20201230,\"querytime\":1609304405769,\"providercode\":\"FECREDIT\",\"customername\":\"VŨ ĐỨC HÙNG\",\"customeraddress\":\"\",\"serviceid\":\"\",\"suppliercode\":\"\",\"paymentrange\":\"\",\"paymentfee\":0,\"expireddate\":\"\",\"isprepaid\":false,\"zlppaymentid\":\"FCCARD\",\"exinfo\":\"{\\\"customercode\\\":\\\"1500020009502248\\\",\\\"customername\\\":\\\"VŨ ĐỨC HÙNG\\\",\\\"companyname\\\":\\\"FC\\\",\\\"address\\\":\\\"***7305\\\",\\\"totaldebt\
func (h *serviceHandler) GetId(ctx context.Context,
req *id.Request, resp *id.Response) error {
logs.Info("GetId with request: %#v", req)
defer logs.Trace("GetId out: %#v", resp)
t := time.Now().Local()
dt := t.Format("060102") // format time yymmdd
key := fmt.Sprintf("id:%d", req.Type)
curr := h.redis.Incr(key)
val, err := curr.Val(), curr.Err()
if err != nil {