设置 git config --global http.https://git.521000.best.proxy socks5://127.0.0.1:1086
设置完成后, ~/.gitconfig
文件中会增加以下条目:
[http "https://github.com"]
proxy = socks5://127.0.0.1:1086
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "llm", | |
# "textual", | |
# ] | |
# /// | |
from textual import on, work | |
from textual.app import App, ComposeResult | |
from textual.widgets import Header, Input, Footer, Markdown |
package test | |
//A very simple example of using user defined structures with instance functions with cel-go | |
import ( | |
"github.com/google/cel-go/cel" | |
"github.com/google/cel-go/checker/decls" | |
"github.com/google/cel-go/common/types" | |
"github.com/google/cel-go/common/types/ref" | |
"github.com/google/cel-go/common/types/traits" |
Install 3scale self managed API gateway (openresty) in Mac OS-X
brew update
brew install pcre openssl
wget http://openresty.org/download/ngx_openresty-1.9.7.2.tar.gz
tar xzvf ngx_openresty-1.9.7.2.tar.gz
cd ngx_openresty-1.9.7.2
import ( | |
"fmt" | |
"strings" | |
"regexp" | |
) | |
var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)") | |
var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])") |
mholt [9:10 AM] | |
When using http.Get(), is it really necessary to read the full response body just to close it later? | |
[9:10] | |
The docs keep saying `Caller should close resp.Body when done reading from it.` and I keep seeing code like this: | |
``` | |
io.Copy(ioutil.Discard, resp.Body) | |
resp.Body.Close() | |
``` |
#!/bin/bash | |
sudo add-apt-repository ppa:chris-lea/libsodium; | |
sudo echo "deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list; | |
sudo echo "deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list; | |
sudo apt-get update && sudo apt-get install libsodium-dev; |
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,