Skip to content

Instantly share code, notes, and snippets.

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

baxiry baxiry

🏠
Working from home
View GitHub Profile
@p4tin
p4tin / Mongo.go
Created December 13, 2015 18:06
Golang Mongo CRUD Example
package mongo
import (
"time"
"log"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
// Profile - is the memory representation of one user profile
@jim3ma
jim3ma / makecert.sh
Last active March 6, 2025 13:05 — forked from spikebike/client.go
Golang TLS server and client
#!/bin/bash
# call this script with an email address (valid or not).
# like:
# ./makecert.sh [email protected]
mkdir certs
rm certs/*
echo "make server cert"
openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1"
echo "make client cert"
openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1"
@corny
corny / lua-udp.lua
Created July 4, 2016 16:08
Lua UDP example
#!/usr/bin/env lua5.2
--
-- apt install lua5.2 lua-socket
--
local socket = require("socket")
local udp = assert(socket.udp())
local data
udp:settimeout(1)
@evalphobia
evalphobia / README.md
Last active April 22, 2025 12:37
Golang Benchmark: gob vs json

tl;dr

  • JSON is faster for small size data
    • map (key size < 50 and Unmarshalling intensive workload)
    • single struct
  • gob is faster for big size data
    • map (key size > 50 or Marshalling intensive workload)
    • slice

(old) about

@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active April 8, 2025 14:21
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@fatih
fatih / caption-transform.go
Created November 16, 2017 19:06
Wordpress captions to Hugo shortcodes. This is a terrible hack, not performant. Only here for reference
package main
import (
"fmt"
"io/ioutil"
"log"
"net/url"
"os"
"path/filepath"
"regexp"
@vurtun
vurtun / _readme_quarks.md
Last active March 29, 2025 00:56
Quarks: Graphical user interface

gui

@AmirSoleimani
AmirSoleimani / main.go
Last active January 10, 2023 08:18
Pub/Sub Pattern Golang
package main
import (
"patternsample/mq"
"fmt"
"time"
)
func main() {
@tom-code
tom-code / h2c.go
Last active July 7, 2023 09:33
golang h2c http2 client and server
package main
import (
"fmt"
"net/http"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"crypto/tls"
"net"
)
@iamranchojr
iamranchojr / main.dart
Last active September 29, 2019 13:44
Flutter Login App
import 'package:flutter/material.dart';
void main(){
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {