Skip to content

Instantly share code, notes, and snippets.

View jcxia43's full-sized avatar
🚢
shipping

Junchen Xia jcxia43

🚢
shipping
View GitHub Profile
@jcxia43
jcxia43 / surge_main.conf
Created October 26, 2015 05:08 — forked from jason5ng32/surge.conf
Surge Configs
// DON'T FORGET TO IMPORT proxy.conf TOO
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
// DNS OVERRIDE, REMOVE # IF YOU NEED
# dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115
@jcxia43
jcxia43 / pr
Last active December 22, 2016 13:03
Easily create GitHub PR in console
#!/usr/bin/env ruby
repo = `git remote show origin -n | grep h.URL | sed 's/.*://;s/.git$//'`.strip
branch = `git rev-parse --abbrev-ref HEAD`
`open https://www.github.com/#{repo}/compare/#{ARGV[0]}...#{branch}`

Keybase proof

I hereby claim:

  • I am jcxia43 on github.
  • I am jcxia (https://keybase.io/jcxia) on keybase.
  • I have a public key whose fingerprint is 3670 A92C 259D 92F4 DFF5 5227 06DD 5BDA 6ECD F1B9

To claim this, I am signing this object:

@jcxia43
jcxia43 / monaco-editor-for-function-call.js
Last active July 18, 2024 17:54
Add the OpenAI function call schema validation to monaco-editor
// OpenAI function call guide: https://platform.openai.com/docs/guides/gpt/function-calling
// JSON Schema reference: https://json-schema.org/understanding-json-schema/
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
validate: true,
schemas: [
{
uri: "http://myserver/foo-schema.json",
fileMatch: ["*"],
schema: {