Skip to content

Instantly share code, notes, and snippets.

View clong365's full-sized avatar
🎯
Focusing

Frank Chen clong365

🎯
Focusing
View GitHub Profile
@ryanhex53
ryanhex53 / proxy.js
Last active April 28, 2023 14:45
openai api proxy server 反向代理服务器
const http = require('http');
const https = require('https');
const { URL } = require('url');
const PORT = process.env.PORT || 80;
const PROXY_URL = process.env.PROXY_URL || 'https://api.openai.com';
// Create an HTTP proxy server to handle client requests
const server = http.createServer((req, res) => {
// Create a URL object based on the proxy server URL in environment variables
@xiaopc
xiaopc / gaWorker.js
Last active October 21, 2025 02:56
Google Analytics 4 Proxy with Cloudflare Workers
// 2023.4.23 更新,修复 gtag.js 加了个回车导致失效的问题
// 2023.3.2 更新,修复上报到 region*.google-analytics.com 未被代理的问题
addEventListener('fetch', (event) => {
// 这里可以加 filter
return event.respondWith(handleRequest(event));
});
// worker 应用的路由地址,末尾不加 '/'
const DOMAIN = 'https://example.workers.dev/routerpath';
@UbuntuEvangelist
UbuntuEvangelist / Cypress.sh
Created July 7, 2020 21:45 — forked from rakibulinux/Cypress.sh
How to install Cypress on Linux Operating System
#!/bin/sh
#Cypress Installation Steps:
# Select a path where Cypress will be installed
mkdir cypress
cd /project/path
or
cd cypress
# Run this command. This will install Cypress locally as a dev dependency for your project
@yougg
yougg / proxy.md
Last active October 10, 2025 06:51
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active October 5, 2025 11:57 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@danilkuznetsov
danilkuznetsov / Export data from H2 database into CSV
Last active June 14, 2023 00:23
Export data from H2 database into CSV
CALL CSVWRITE('/home/<user>/downloads/<table_name>'.csv', 'SELECT * FROM <table_name>', 'charset=UTF-8 fieldSeparator=;');
Without field delimiter "
CALL CSVWRITE('/home/<user>/downloads/<table_name>'.csv', 'SELECT * FROM <table_name>', 'charset=UTF-8 fieldSeparator=; fieldDelimiter=');
@brambow
brambow / postgis-to-geojson-feature-collection.sql
Last active April 25, 2023 15:44
PostGIS query to build a GeoJSON FeatureCollection
SELECT json_build_object(
'type', 'FeatureCollection',
'crs', json_build_object(
'type', 'name',
'properties', json_build_object(
'name', 'EPSG:4326'
)
),
'features', json_agg(
json_build_object(
@SimonTart
SimonTart / .npmrc
Last active November 19, 2022 09:57
npmrc config for china
registry=https://registry.npm.taobao.org
disturl=https://npm.taobao.org/dist
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver
operadriver_cdnurl=https://npm.taobao.org/mirrors/operadriver
selenium_cdnurl=https://npm.taobao.org/mirrors/selenium
node_inspector_cdnurl=https://npm.taobao.org/mirrors/node-inspector
fsevents_binary_host_mirror=http://npm.taobao.org/mirrors/fsevents/
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active October 21, 2025 21:16
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nathanchrs
nathanchrs / set-proxy
Created February 23, 2017 12:52
Bash script to set proxy on Linux
#!/usr/bin/env bash
# Sets proxy settings.
# Run using `source` command. apt-get proxy settings requires sudo privileges.
# By nathanchrs.
# Configuration
# PROXY_HOST=""
# PROXY_USER=""
# PROXY_PASSWORD=""