Skip to content

Instantly share code, notes, and snippets.

View bojand's full-sized avatar
💭
I may be slow to respond.

Bojan bojand

💭
I may be slow to respond.
View GitHub Profile
@bojand
bojand / driver-service-server.go
Last active August 8, 2017 18:05
Hot R.O.D. driver service fixed
// Copyright (c) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@bojand
bojand / list.md
Last active October 6, 2017 17:06
Chart libraries

List

  • d3
  • Flot
  • vis.js
  • Highcharts
  • Google charts
  • Raphael
  • Processing.js
  • Chart.js
  • Chartist.js
@bojand
bojand / async.md
Created November 17, 2017 18:49
async + await

asynctest.js

function foo() {
  return 'bar'
}

async function afoo() {
  return 'bar'
}
@bojand
bojand / types.go
Created March 16, 2018 13:22
Go type conversions
package main
import (
"fmt"
"time"
)
const layout = "2006-01-02"
type MyBool bool
@bojand
bojand / nil_len.go
Created April 5, 2018 11:55
nil and len() in Go
package main
import (
"fmt"
)
type Foo struct{}
func main() {
var nilPtr *Foo
@bojand
bojand / tags1.go
Created April 20, 2018 12:33
Go Tags
package main
import (
"fmt"
"reflect"
)
type User struct {
FullName string `json:"full_name" binding:"required"`
Age int `json:"age" binding:"required,min=1"`
@bojand
bojand / mytype.go
Last active May 16, 2018 23:53
Custom JSON Marshal
package main
import (
"encoding/json"
"fmt"
"time"
)
const layout = "2006-01-02"
@bojand
bojand / data.go
Last active June 14, 2018 17:42
parallel data
package main
import (
"encoding/json"
"fmt"
)
type User struct {
ID int `json:"id"`
Name string `json:"name"`
@bojand
bojand / README.md
Last active June 29, 2018 12:22
Simple WebAssembly fibonacci performance test

Simple, quick performance demo / test comparing JavaScript and WebAssembly. Uses fibonacci (n = 40) with 31 runs.

Convert fib.wat to wasm using wat2wasm tool and download as fib.wasm.

Use Node.js 10.

Run:

node index.js
@bojand
bojand / limit.go
Created July 7, 2018 22:51
go concurrency
package main
import (
"fmt"
"strings"
"time"
)
func upper(input string) string {
fmt.Println("upper " + input)