Skip to content

Instantly share code, notes, and snippets.

@lmm214
lmm214 / gist.php
Last active August 29, 2015 14:03 — forked from ccbikai/gist.php
WordPress 使用 iframe 嵌入Github Gist代码,使用方法单独起一行写入: https://gist.github.com/
function wp_iframe_handler_gist( $matches, $attr, $url, $rawattr ) {
$iframe = '<iframe width="100%" height="300" src="https://gist.github.com/'. esc_attr($matches[1]) .'/'. esc_attr($matches[2]) . '.pibb" frameborder=0 ></iframe>';
return apply_filters( 'iframe_gist', $iframe, $matches, $attr, $url, $rawattr );
}
wp_embed_register_handler( 'gist_iframe', '#https://gist.github.com/(.*?)/([\w]+)#i', 'wp_iframe_handler_gist' );
//七牛云缓存:新建空间,镜像源设置成“https://gist.github.com/”,然后把上面代码中的这句链接改成“https://你的空间项目.qiniudn.com/”
@lmm214
lmm214 / cloudflare-worker-proxy.js
Created March 5, 2023 15:07 — forked from noobnooc/cloudflare-worker-proxy.js
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.