| command | description |
|---|---|
| ctrl + a | Goto BEGINNING of command line |
| #!/bin/sh | |
| # | |
| # CloudFlare Dynamic DNS | |
| # | |
| # Updates CloudFlare records with the current public IP address | |
| # | |
| # Takes the same basic arguments as A/CNAME updates in the CloudFlare v4 API | |
| # https://www.cloudflare.com/docs/client-api.html#s5.2 | |
| # | |
| # Use with cron jobs etc. |
| # | |
| # Name: nginx-tls.conf | |
| # Auth: Gavin Lloyd <[email protected]> | |
| # Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating | |
| # | |
| # Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related | |
| # to SSL/TLS are not included here. | |
| # | |
| # Additional tips: | |
| # |
| - What do Etcd, Consul, and Zookeeper do? | |
| - Service Registration: | |
| - Host, port number, and sometimes authentication credentials, protocols, versions | |
| numbers, and/or environment details. | |
| - Service Discovery: | |
| - Ability for client application to query the central registry to learn of service location. | |
| - Consistent and durable general-purpose K/V store across distributed system. | |
| - Some solutions support this better than others. | |
| - Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state. | |
| - Centralized locking can be based on this K/V store. |
| # post_loc.txt contains the json you want to post | |
| # -p means to POST it | |
| # -H adds an Auth header (could be Basic or Token) | |
| # -T sets the Content-Type | |
| # -c is concurrent clients | |
| # -n is the number of requests to run in the test | |
| ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
| <?php | |
| // 欧几里得度量_百度百科 http://baike.baidu.com/link?url=zAEZl46AoeKqIg0v1n_nPWP5JycEYvoOepRf_lTin_i-nb9YTNQGOFILLYYqTxF3Nho0Wn5vWgNWTYHklq0mE_ | |
| function distance() | |
| { | |
| $argv = func_get_args(); | |
| $argc = func_num_args(); | |
| if ($argc !== sizeof($argv)) return; | |
| $res = $j = intval(NULL); | |
| for (; $j < sizeof($argv[0]); $j++) |
EDIT from 2019: Hi folks. I wrote this gist for myself and some friends, and it seems like it's gotten posted somewhere that's generated some (ahem, heated) discussion. The whitespace was correct when it was posted, and since then GitHub changed how it formats (thank you @anzdaddy for suggesting a formatting workaround) honestly this is a random throwaway gist from 2015, and someone more knowledgable about this comparison should just write a proper blog post about it. If you comment here I'll hopefully see it and stick a link to it up here. Cheers. @oconnor663<pre> tags. Look at the raw text if you care about this. I'm sure someone could tell me how to fix it, but
Here's the canonical TOML example from the TOML README, and a YAML version of the same.
title = "TOML Example" |
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
| 1. my+ 1001. se+ 2001. thedaily+ 3001. empire+ 4001. herb+ | |
| 2. +online 1002. test+ 2002. giant+ 3002. +cook 4002. +teen | |
| 3. the+ 1003. fish+ 2003. survey+ 3003. +deluxe 4003. affordable+ | |
| 4. +web 1004. hk+ 2004. +conference 3004. +crunch 4004. proto+ | |
| 5. +media 1005. florida+ 2005. twit+ 3005. michigan+ 4005. +ity | |
| 6. web+ 1006. fine+ 2006. pick+ 3006. cars+ 4006. myhome+ | |
| 7. +world 1007. loan+ 2007. +dvd 3007. +forest 4007. plastic+ | |
| 8. +net 1008. page+ 2008. cinema+ 3008. yacht+ 4008. +kc | |
| 9. go+ 1009. fox+ 2009. desi+ 3009. +wallet 4009. +foot | |
| 10. +group 1010. +gift 2010. act+ 3010. +contest 4010. +sup |
| package main | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "fmt" | |
| "strconv" | |
| ) | |
| func main() { |
