Skip to content

Instantly share code, notes, and snippets.

View burubur's full-sized avatar
🏠
Working from home

Burhan Mubarok burubur

🏠
Working from home
View GitHub Profile
@burubur
burubur / fakegen.go
Last active October 20, 2020 03:09
Fake Data Generator - Generate some fake data to postgesql
package main
import (
"database/sql"
"fmt"
"log"
"sync"
"time"
"github.com/bwmarrin/snowflake"
@burubur
burubur / mockgen.sh
Created June 14, 2020 00:13
Generate mock file based on interface changes using mockgen
#!/usr/bin/env bash
# mockgen will generates a mock file based on interface changes
# example:
# there is changes on the following interface
# /pkg/sharedcontract/httpconnector.go
# then the mock will be generated to:
# /test/fixture/mock/httpconnector_mock.go
#
# for further mock usage, refer to https://github.com/golang/mock

Slack Shortcut

Set sprint planning reminder

/remind “Hi @devs, it’s time for Sprint Planning! - Please join https://gojek.zoom.us/my/link” every biweekly March 27 at 04:00pm

Set daily standup reminder

@burubur
burubur / .gitignore
Created February 21, 2020 18:58
common .gitignore
**.idea
**.vscode
**.DS_STORE
**main
**vendor
coverage.out
@burubur
burubur / .editorconfig
Created February 21, 2020 18:57
common .editorconfig
; http://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
@burubur
burubur / midpoint.rb
Created January 31, 2020 08:41
ruby - midpoint calculation
def midpoint(points)
return [] if points.blank?
coords = points.map {|p| new(*p).to_radians if p.present?}.compact
# convert to Cartesian coordinates
x = []
y = []
z = []
coords.each do |p|
@burubur
burubur / list_search_benchmark.rb
Last active January 21, 2020 18:13
Ruby - List Search Benchmarking (Array, Hash Map, Set)
require 'json'
require 'benchmark'
require 'set'
class Bencmarking
def prepare
write_config
end
def run
require 'json'
require 'benchmark'
class BaseRuntime
def figlet
puts "starting service..."
end
end
class MainRuntime < BaseRuntime
package main
func main() {
println("string yang super simpel ini akan diprint/dicetak pada terminal kita")
}
package main
import (
"fmt"
"os"
"runtime"
)
var template = `
nama mesin %33v