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
@crodjer
crodjer / test_ws.py
Created August 22, 2015 12:50
Application to demonstrate testing tornado websockets
'''
Application to demonstrate testing tornado websockets.
Try it wiith: python -m tornado.testing discover
'''
from tornado import testing, httpserver, gen, websocket
from ws import APP
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@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 || {}
package wincommands
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
@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"
@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
@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.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"errors"
"flag"
"fmt"
"io"
@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"
@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"