Skip to content

Instantly share code, notes, and snippets.

View wuriyanto48's full-sized avatar

wuriyanto wuriyanto48

View GitHub Profile
SELECT s.id, s.sha1, f.name
FROM storage s
JOIN file f ON s.id = f.storage_id
WHERE s.count > 0
ORDER by id DESC, name ASC
OFFSET 1000 LIMIT 10
------------------------------
db.file_storage.aggregate([
@wuriyanto48
wuriyanto48 / main.go
Created September 20, 2018 03:58
Golang (interface to slice string)
package main
import (
"encoding/json"
"fmt"
"reflect"
)
var data = `[
{
@wuriyanto48
wuriyanto48 / 00 [clojure 高阶函数用法整理].md
Created September 21, 2018 02:43 — forked from BUNotesAI/00 [clojure 高阶函数用法整理].md
clojure higher-order functions clj 高阶函数

clojure higher-order functions

package main
import (
"fmt"
"encoding/json"
"time"
)
type Person struct {
ID string `json:"id"`
@wuriyanto48
wuriyanto48 / main.go
Created October 17, 2018 08:38
execute function every seconds in concurrent way
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"time"
)
@wuriyanto48
wuriyanto48 / main.go
Created October 30, 2018 08:22
how to achieve interface inheritance in go
package main
import (
"fmt"
"errors"
)
type Person struct {
ID string
Name string
@wuriyanto48
wuriyanto48 / main.go
Last active March 21, 2023 15:11
Simple retry mechanism in Go
package main
import (
"context"
"errors"
"fmt"
"time"
)
type Func func() bool
@wuriyanto48
wuriyanto48 / redis_client_simple.go
Created January 19, 2019 07:24
simple redis client without any library
package main
import (
"fmt"
"net"
"os"
)
func main() {
addr, err := net.ResolveTCPAddr("tcp", "127.0.0.1:6379")
@wuriyanto48
wuriyanto48 / main.go
Created January 30, 2019 12:22
golang function options
package main
import (
"fmt"
)
func main() {
c := Call("wuriyanto", aOptions("self"), bOptions("taught coder"), cOptions(true))
fmt.Println(c)
}
@wuriyanto48
wuriyanto48 / go_func_option_v2.go
Created February 2, 2019 16:33
using go function as an option
package main
import (
"fmt"
)
func main() {
c := Call("wuriyanto", aOptions("self"), bOptions("taught coder"), cOptions(true))
fmt.Println(c)
}