- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.gitsudo nano ~/.bash_profile
- Add
export PATH=/path/to/depot_tools:"$PATH"(it's important that depot_tools comes first here)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| upstream gitlab { | |
| server 172.17.42.1:10080 fail_timeout=0; | |
| } | |
| # let gitlab deal with the redirection | |
| server { | |
| listen 80; | |
| server_name git.example.com; | |
| server_tokens off; | |
| root /dev/null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # System Preferences -> Accessibility -> Display -> Reduce motion | |
| tell application "Messages" to activate | |
| tell application "Messages" | |
| set chatCount to (count of chats) | |
| end tell | |
| tell application "System Events" | |
| tell process "Messages" |
Generally, the Git proxy configuration depends on the Git Server Protocal you use. And there're two common protocals: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.
When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocal. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:
ProxyCommand nc -x localhost:1080 %h %p
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| hash git 2>/dev/null || { echo >&2 "Required command 'git' is not installed. ( hmm... why are you using this? ) Aborting."; exit 1; } | |
| hash realpath 2>/dev/null || { echo >&2 "Required command 'realpath' is not installed. Aborting."; exit 1; } | |
| hash pwd 2>/dev/null || { echo >&2 "Required command 'pwd' is not installed. Aborting."; exit 1; } | |
| hash cd 2>/dev/null || { echo >&2 "Required command 'cd' is not installed. Aborting."; exit 1; } | |
| hash echo 2>/dev/null || { echo >&2 "Required command 'echo' is not installed. Aborting."; exit 1; } | |
| hash mv 2>/dev/null || { echo >&2 "Required command 'mv' is not installed. Aborting."; exit 1; } | |
| hash diff 2>/dev/null || { echo >&2 "Required command 'diff' is not installed. Aborting."; exit 1; } | |
| hash diffstat 2>/dev/null || { echo >&2 "Required command 'diffstat' is not installed. Aborting."; exit 1; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from os import listdir | |
| from os import walk | |
| from os.path import isfile,isdir,join | |
| from chardet.universaldetector import UniversalDetector | |
| # may need to `pip3 install chardet` | |
| import codecs | |
| detector = UniversalDetector() | |
| # change the targetPath to your path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Builds NGINX from the QUIC+HTTP/3 development branch | |
| # - Based on the official NGINX docker image, including all modules built by default | |
| # - OpenSSL replaced with LibreSSL to support QUIC's TLS requirements (statically linked) | |
| # | |
| # docker build --no-cache -t nginx:quic . | |
| # docker run -d -p 443:443 -p 443:443/udp nginx:quic | |
| # | |
| # Note that a suitable configuration file and TLS certificates are required for testing! | |
| # See <https://quic.nginx.org/readme.html> for more info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Ai } from './vendor/@cloudflare/ai.js'; | |
| export default { | |
| async fetch(request, env) { | |
| const ai = new Ai(env.AI); | |
| // prompt - simple completion style input | |
| // let simple = { | |
| // prompt: 'Tell me a joke about Cloudflare' | |
| // }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| ) | |
| func main() { | |
| // Create file server handler | |
| fs := http.FileServer(http.Dir("./media")) |
OlderNewer