Skip to content

Instantly share code, notes, and snippets.

View cofyc's full-sized avatar
🎯
Focusing

Yecheng Fu cofyc

🎯
Focusing
View GitHub Profile
@cofyc
cofyc / gist:1202cbdb047dde7a44fa
Created November 10, 2014 13:09
chart_bar.php.fix.48172.diff
Index: chart_bar.php
===================================================================
--- chart_bar.php (版本 48171)
+++ chart_bar.php (版本 48172)
@@ -171,9 +171,9 @@
' sum(num) as count,avg(value_avg) as avg,min(value_min) as min,'.
' max(value_max) as max,max(clock) as clock'.
' FROM trends '.
- ' WHERE itemid='.$itemid.
- ' AND clock>='.$timesince.
@cofyc
cofyc / rfc.fix.user.js
Last active August 29, 2015 14:12
rfc fix userscript
// ==UserScript==
// @name rfc fix
// @namespace http://yechengfu.com
// @version 0.1
// @description Fix h1 headers on http://tools.ietf.org/html/rfc* pages.
// @author Yecheng Fu
// @match http://tools.ietf.org/html/rfc*
// @require http://a.tbcdn.cn/libs/jquery/1.7.1/jquery.js
// @grant none
// ==/UserScript==
@cofyc
cofyc / reenable_password_pasting.user.js
Created January 4, 2015 16:48
Re-enable password pasting
// ==UserScript==
// @name Re-enable password pasting
// @namespace http://yechengfu.com
// @version 0.1
// @description Re-enable password pasting.
// @author Yecheng Fu
// @match https://accounts.ctrip.com/*
// @grant none
// @refer http://prioritized.net/blog/re-enabling-password-pasting-on-annoying-web-forms/
// ==/UserScript==
# Uncrustify 0.59
# Default Config: http://uncrustify.sourceforge.net/default.cfg
#
# General options
#
# The type of line endings
newlines = auto # auto/lf/crlf/cr
/**
* dnspod-sr architecture
* Date: Fri Jan 23 22:44:47 2015 +0800
* Author: Yecheng Fu <[email protected]>
*/
digraph G {
// graph
labelloc="t"
splines=true
label="dnspod-sr architecture"
@cofyc
cofyc / xrunc
Created January 24, 2015 16:12
A handy tool to compile and execute C source directly.
#!/usr/bin/env python
#
# A handy tool to compile and execute C source directly.
#
# @author Yecheng Fu <[email protected]>
import os
import sys
import tempfile
import subprocess
package main
import (
"flag"
"fmt"
"sync"
"time"
)
var (
@cofyc
cofyc / debug.log
Created May 18, 2017 16:27
vagrant debug
INFO global: Vagrant version: 1.9.5
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_USER="cofyc"
INFO global: VAGRANT_OLD_ENV_TERM_PROGRAM="Apple_Terminal"
INFO global: VAGRANT_OLD_ENV_TERM_PROGRAM_VERSION="361.1"
INFO global: VAGRANT_OLD_ENV_XPC_SERVICE_NAME="0"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/gems/vagrant-1.9.5/bin/vagrant"
INFO global: VAGRANT_OLD_ENV_DISPLAY="/private/tmp/com.apple.launchd.KuClk7L7wV/org.macosforge.xquartz:0"
@cofyc
cofyc / evalsymlinks.go
Last active April 11, 2018 03:58
EvalSymlinksAtRoot
@cofyc
cofyc / demo.json
Last active May 10, 2019 19:13
Demo TiDB cluster files for tidb-operator in OLM
{
"apiVersion": "pingcap.com/v1alpha1",
"kind": "TidbCluster",
"metadata": {
"name": "demo",
"namespace": "operators"
},
"spec": {
"pd": {
"image": "pingcap/pd:v2.1.0",