Skip to content

Instantly share code, notes, and snippets.

View xpzouying's full-sized avatar
🎻
Life is better when shared

zy xpzouying

🎻
Life is better when shared
View GitHub Profile
@xpzouying
xpzouying / README.md
Created October 24, 2024 11:26 — forked from wong2/README.md
How to run Claude computer use demo on macOS

Note

It is necessary to give Terminal (or iTerm or whatever you use) the permission to control the computer. This can be done in System Settings ➔ Privacy & Security ➔ Accessibility.

Guide

  • Install cliclick for mouse & keyboard emulation
    • brew install cliclick
  • Clone Anthropic quickstart repo
    • git clone https://github.com/anthropics/anthropic-quickstarts.git
  • cd computer-use-demo
  • Replace computer-use-demo/computer_use_demo/tools/computer.py with the modified version below
@xpzouying
xpzouying / chatglm-openai-api.ipynb
Created April 22, 2023 08:12 — forked from ninehills/chatglm-openai-api.ipynb
chatglm-openai-api.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xpzouying
xpzouying / chatpdf-zh.ipynb
Created April 3, 2023 09:21 — forked from ninehills/chatpdf-zh.ipynb
ChatPDF-zh.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xpzouying
xpzouying / http-server-shutdown.go
Created February 19, 2023 16:41 — forked from rgl/http-server-shutdown.go
go http server with graceful shutdown
package main
import (
"context"
"flag"
"log"
"net/http"
"os"
"os/signal"
"time"
@xpzouying
xpzouying / .vimrc
Created October 13, 2022 00:50 — forked from jdah/.vimrc
jdh's NeoVim .vimrc
call plug#begin()
Plug 'drewtempelmeyer/palenight.vim'
Plug 'vim-airline/vim-airline'
Plug 'wlangstroth/vim-racket'
Plug 'sheerun/vim-polyglot'
Plug 'rust-lang/rust.vim'
Plug 'preservim/tagbar'
Plug 'universal-ctags/ctags'
Plug 'luochen1990/rainbow'
Plug 'vim-syntastic/syntastic'
@xpzouying
xpzouying / decorator.go
Created July 29, 2022 02:14 — forked from saelo/decorator.go
Decorators in Go
package main
import (
"fmt"
"reflect"
)
func Decorate(impl interface{}) interface{} {
fn := reflect.ValueOf(impl)
@xpzouying
xpzouying / proxy.go
Created February 22, 2021 13:09 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@xpzouying
xpzouying / vm-setup.sh
Created December 13, 2020 16:53 — forked from nf/vm-setup.sh
Script for setting up Debian Jessie VM with my development environment
#!/bin/bash -e
echo '
PATH=$HOME/go/bin:$PATH
export GOPATH=$HOME
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
@xpzouying
xpzouying / whitelist.md
Created July 13, 2020 10:21 — forked from kivikakk/whitelist.md
HTML sanitizer whitelist for user content on GitHub.com
  • Any allowed id and name attributes have "user-content-" prefixed to their value.
  • A maximum of 2 nested sub or sup tags are allowed.
  • A maximum of 10 nested ul or ol tags are allowed.
Allowed Element Allowed Attributes
All allowed elements abbr, accept, accept-charset, accesskey, action, align, alt, axis, border, cellpadding, cellspacing, char, charoff, charset, checked, clear, color, cols, colspan, compact, coords, datetime, dir, disabled, enctype, for, frame, headers, height, hreflang, hspace, id, ismap, itemprop, label, lang, maxlength, media, method, multiple, name, nohref, noshade, nowrap, open, prompt, readonly, rev, rows, rowspan, rules, scope, selected, shape, size, span, start, summary, tabindex, title, type, usemap, valign, value, vspace, width
a As above plus href (must be github-mac, github-windows, http,
@xpzouying
xpzouying / example-go-unsafe-pointer.go
Created March 22, 2020 15:58
example-go-unsafe-pointer
package main
import (
"log"
"unsafe"
)
func main() {
x := make([]byte, 8)
x[0] = 3