Skip to content

Instantly share code, notes, and snippets.

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

Ybb ego008

🏠
Working from home
View GitHub Profile
package main
import (
agwd "github.com/sclevine/agouti"
tbwd "github.com/tebeka/selenium"
"log"
sgwd "sourcegraph.com/sourcegraph/go-selenium"
)
// Helper for sourcegraph/go-selenium
@willshiao
willshiao / aes.go
Last active January 10, 2025 18:00
AES 256-CFB in Node.js, Go, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
@xeoncross
xeoncross / traverse_node.go
Created January 5, 2017 16:29
Simple DOM node traversal in golang using a very useful collector/matcher function
package main
import (
"bytes"
"fmt"
"io"
"strings"
"unicode"
"golang.org/x/net/html"
@jaksi
jaksi / main.go
Created December 23, 2016 17:32
Go web server
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"log"
"net/http"
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"errors"
"flag"
"fmt"
"io"
@c4milo
c4milo / httpclient.go
Last active August 3, 2017 05:35
HTTP client with support for read and write timeouts which are missing in Go's standard library.
package httpclient
import (
"context"
"net"
"net/http"
"time"
)
// DialContextFn was defined to make code more readable.
@bjoern-r
bjoern-r / Huawei_E3372_openwrt.md
Last active April 30, 2025 07:44
How to use a Huawei E3372 on OpenWRT

HOWTO use a Huawei E3372 on OpenWRT

This modem is also sold as a MegaFon M150-2 USB dongle

Needed Software

Install the needed packages via opkg tool

opkg update
@dmitshur
dmitshur / main.go
Last active January 28, 2018 08:48
Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
// Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
package main
import (
"crypto/tls"
"flag"
"log"
"net/http"
"net/http/httputil"
"time"
package wincommands
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
@gilbert
gilbert / view-model-example.js
Last active October 6, 2019 23:39
Mithril View-Model Example
var Comment = {]
Comment.create = function (attrs) {
return m.request({ method: 'POST', url: '/comments', data: attrs })
}
// A view-model is basically a temporary, disposable copy of a model.
// It allows the user can either commit or cancel the changes they make.
Comment.vm = function (attrs) {
attrs = attrs || {}