Skip to content

Instantly share code, notes, and snippets.

View timonwong's full-sized avatar
😶

Timon Wong timonwong

😶
View GitHub Profile
@timonwong
timonwong / confluence-navbar-fix.user.js
Last active June 8, 2022 06:39
Confluence NavBar Fix
// ==UserScript==
// @name Confluence NavBar Fix
// @name:zh-CN Confluence导航按钮修复
// @description Fix missing NavBar Button
// @description:zh-CN 修正 Confluence 消失的导航条和导航按钮
// @namespace https://theo.im
// @version 0.1.1
// @license MIT
// @author Timon Wong
// @match *://confluence.alauda.cn/*

Keybase proof

I hereby claim:

  • I am timonwong on github.
  • I am timonwong (https://keybase.io/timonwong) on keybase.
  • I have a public key ASDs1Y4E2mfuVF9a2pO59hFeVhVC6R8ZkGl_1eLxqkpunQo

To claim this, I am signing this object:

http://stackoverflow.com/questions/22717428/vagrant-error-failed-to-mount-folders-in-linux-guest
@timonwong
timonwong / gist:eb45ca8b90128f0d49d2
Created May 14, 2015 08:05
Ubuntu 14.04 mirror using aliyun
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
@timonwong
timonwong / gist:748f73b7686be0cc8190
Created May 14, 2015 06:18
Shutdown all containers
sudo docker ps -a | awk '{print $1}' | grep -v "CONTAINER" | xargs --no-run-if-empty sudo docker rm
@timonwong
timonwong / mysqldump.py
Created February 27, 2015 01:46
django mysqldump management command
# -*- coding: utf-8 -*-
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from django.db import connections
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import BaseDatabaseClient
@timonwong
timonwong / stringinfo.py
Last active August 29, 2015 14:05
A very simple System.Globalization.StringInfo class, ported from .net world
import unicodedata
import sys
__all__ = ['UnicodeCategory', 'StringInfo']
PY3K = sys.version_info[0] >= 3
if PY3K:
unicode_type = str
else:
@timonwong
timonwong / go_stacktrace.go
Created July 21, 2014 06:28
Go stack trace
package main
import (
"fmt"
"runtime"
)
func StackTrace(all bool) string {
// Reserve 10K buffer at first
buf := make([]byte, 10240)
#!/bin/bash
# !!path to the pip binary!!
PIP_BIN=/opt/python2.7/bin/pip
WHEEL_DIR=wheelhouse
DOWNLOAD_CACHE_DIR=cache
PIP_WHELL_REQUIREMENT="$@"
@timonwong
timonwong / 1consumer_1producer_then_exhaust_connections.py
Last active August 29, 2015 14:01
Demonstrate that RabbitMQ consumer will get blocked after all connections exhausted
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
import threading
import time
import kombu.common
import kombu.pools