Skip to content

Instantly share code, notes, and snippets.

View wuriyanto48's full-sized avatar

wuriyanto wuriyanto48

View GitHub Profile
@wuriyanto48
wuriyanto48 / obj_min.js
Last active April 11, 2017 10:48
Find minimum value from object in Javascript
let price = {
"vendorPrice": 150000,
"normalPrice": 229000,
"pPrice": 90000,
"specialPrice": 169000,
"promoPrice": 0
};
function minPrice(prices){
let arrPrices = [];
@wuriyanto48
wuriyanto48 / pbkdf2_crypto_nodejs.js
Last active April 24, 2017 07:10
Encrypt and Verify PBKDF2 using Crypto Node Js (Note: in this example number of Iterations are included in Salt)
'use strict';
let crypto = require('crypto');
let config = {
digestAlgorithm: 'sha1',
keyLen: 64,
saltSize: 64,
iterations: 15000
};
package main
import (
"fmt"
"sync"
)
var wg sync.WaitGroup
type Processor struct {
@wuriyanto48
wuriyanto48 / findHighestFieldInsideStruct.go
Created August 7, 2017 08:08
FInd Highest Value inside Go Struct's Field
package main
import (
"fmt"
"encoding/json"
)
type ShippingCostReadModel struct {
@wuriyanto48
wuriyanto48 / go_func_as_parameter.go
Last active November 4, 2018 04:14
Golang Function as Parameter example
package main
import (
"fmt"
"strings"
)
type fo func(key string, value string) bool
func Check(key string, data []string, op fo) []string{
@wuriyanto48
wuriyanto48 / golang_reduce_map.go
Last active December 11, 2022 18:04
How to Join Map In Golang (Map Union)
package main
import (
"fmt"
)
type Item struct{
Id int
Name string
Qty int
@wuriyanto48
wuriyanto48 / event_listener.go
Created April 3, 2018 16:05
what the heck is this..
package main
import (
"fmt"
)
type OnClickListener interface {
OnClick()
}
@wuriyanto48
wuriyanto48 / event_listener.go
Created April 3, 2018 16:05
what the heck is this..
package main
import (
"fmt"
)
type OnClickListener interface {
OnClick()
}
@wuriyanto48
wuriyanto48 / main_test.go
Created May 11, 2018 05:32 — forked from alexedwards/main_test.go
MaxOpenConns benchmark
package main
import (
"database/sql"
"testing"
"time"
_ "github.com/lib/pq"
)
@wuriyanto48
wuriyanto48 / main.go
Created September 7, 2018 03:12
Database migration in Mongo Db from JSON data
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"time"