Skip to content

Instantly share code, notes, and snippets.

View fbzhong's full-sized avatar

Robin Zhong fbzhong

View GitHub Profile
@fbzhong
fbzhong / add_connect_bypass_nextproxy_support.path
Created June 15, 2011 16:24
add CONNECT bypass NextProxy support for Ziproxy 3.2.0
From 185ff4a2980137182a8bd2cbaf72973769cbd54d Mon Sep 17 00:00:00 2001
From: robin <[email protected]>
Date: Thu, 16 Jun 2011 00:10:24 +0800
Subject: [PATCH] add CONNECT bypass NextProxy support.
---
src/http.c | 192 +++++++++++++++++++++++++++++++--------------------------
src/http.h | 7 +-
src/ziproxy.c | 35 ++++++-----
3 files changed, 127 insertions(+), 107 deletions(-)
@fbzhong
fbzhong / zh_CN.php
Created July 5, 2011 05:39
HTTPS fix for wordpress language zh_CN.php
function zh_cn_language_pack_backend_style_modify() {
$styleUrl = WP_CONTENT_URL . '/' . ZH_CN_PACK_LANGUAGE_DIR_TO_CONTENT . 'zh_CN-dashboard.css';
$styleFile = WP_CONTENT_DIR . '/' . ZH_CN_PACK_LANGUAGE_DIR_TO_CONTENT . 'zh_CN-dashboard.css';
if ( file_exists( $styleFile ) ) {
+ if ( 0 === strpos($styleUrl, 'http') && is_ssl() )
+ $styleUrl = str_replace( 'http://', 'https://', $styleUrl );
wp_register_style( 'zh-cn-pack-style-dashboard', $styleUrl, array(), '1.0');
wp_enqueue_style( 'zh-cn-pack-style-dashboard' );
}
}
@fbzhong
fbzhong / gist:1621850
Created January 16, 2012 17:13
Sample for JavaScript Indent of TextMate 2
// The following is what I want.
(function($, Animation, undefined) {
/**
* @desc Set visiblity to visible.
*/
$.fn.visible = function() {
this.css('visibility', 'visible');
};
@fbzhong
fbzhong / go-auto-set-gopath.zsh
Last active September 19, 2017 16:08
Auto config GOPATH
# auto config GOPATH.
# /home/robin/workspace/src/github.com/
export _OLDGOPATH=${GOPATH}
go-auto-set-gopath() {
curdir=`pwd`
gopath=""
array=(${(s:/:)curdir})
for ele in "${array[@]}" ; do
if [ "${ele}" = "src" ] ; then
break
@fbzhong
fbzhong / discord_webhook_send.sh
Last active March 15, 2025 16:36
Discord Webhook Message Sender
#!/bin/bash
# This script sends a message to a Discord webhook or edits an existing message based on whether a local file containing the message ID exists.
# Requirements:
# - DISCORD_WEBHOOK_URL environment variable must be set to the Discord webhook URL.
# - jq must be installed for parsing JSON responses.
# Usage:
# export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/xxx/yyy"