Skip to content

Instantly share code, notes, and snippets.

View weaming's full-sized avatar
🦀
Rustacean

Garden Yuen weaming

🦀
Rustacean
  • Shenzhen, China
View GitHub Profile
#!/usr/bin/env python
import sys
from graphviz import Digraph
dot = Digraph(comment='alembic')
def split_line(line):
bases, _, name_and_target = line.partition('->')
id_and_stuff, _, desc = name_and_target.strip().partition(',')
func uploadWeibo(fn string) ([]byte, error) {
file, err := os.Open(fn)
if err != nil {
return nil, err
}
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
@staaldraad
staaldraad / webdavserv.go
Last active April 14, 2024 03:53
A small webdav server in go
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
"golang.org/x/net/webdav"
@cmer
cmer / haproxy.cfg
Last active April 15, 2024 09:54
Simple, no bullshit TCP port forwarding using HAProxy
listen l1
bind 0.0.0.0:443
mode tcp
timeout connect 4000
timeout client 180000
timeout server 180000
server srv1 host.example.com:9443
@easychen
easychen / weibopicbed.js
Created July 16, 2017 08:30
微博图床上传函数
// from https://github.com/suxiaogang/WeiboPicBed
// under its license
function uploadToWeibo( url , callback )
{
var xhr = new XMLHttpRequest();
xhr.onload = function() {
var reader = new FileReader();
reader.onloadend = function( e )
{
@oliveratgithub
oliveratgithub / emojis.json
Last active May 9, 2024 20:25
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z
@douglasmiranda
douglasmiranda / install.sh
Last active October 23, 2019 02:26
After Install Ubuntu 17.10 - Chrome, Fish Shell, Docker, Docker Compose
sudo apt update
sudo apt upgrade -y
# Remember: install / verify additional drivers
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt update
# google chrome and chrome extension to use gnome extensions
@shellexy
shellexy / NoCSS.js
Created January 6, 2018 11:44
去除网页样式的 bookmarklet 书签工具
javascript:
(function(){
if (f=document.querySelector('frame[name="Main"]')) {
window.location.href = f.src;
}
document.body.style.margin = "10%";
document.body.style.lineHeight = "2em";
document.body.bgColor = "#F5F5B5";
document.body.text = "#000000";
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active May 10, 2024 14:43
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@sebastien
sebastien / nix-fishgen.py
Last active May 31, 2021 02:52
Python script that converts Nix's profile bash script to Fish
#!/usr/bin/env python3
# Updated: 2018-10-17
import re, sys, os
"""
Converts the Nix profile SH script to a Fish-compatible profile using a
simple line-by-line replace algorithm.
"""