get latest commit of specific file
git log -n 1 --pretty=oneline -- <file-name.ext> | cut -f 1 -d' ’| #!/bin/sh | |
| alias dm='docker-machine' | |
| alias dmx='docker-machine ssh' | |
| alias dk='docker' | |
| alias dki='docker images' | |
| alias dks='docker service' | |
| alias dkrm='docker rm' | |
| alias dkl='docker logs' | |
| alias dklf='docker logs -f' |
| curl -H "Authorization: bearer <token>" -X POST -d \ | |
| '{"query": "query { repository(owner:\"octocat\", name:\"Hello-World\") { issues(last:20, states:CLOSED) { edges { node { title url labels(first:5) { edges { node { name}}}}}}}}"}' \ | |
| https://api.github.com/graphql |
| wget -q -S -O - --spider <host>:<port>/<path> &>/dev/null; [ $? -eq 0 ] || exit 1 |
| (defn starts-with-any? | |
| [s prefixes] | |
| (some #(clojure.string/starts-with? s %) prefixes)) | |
| (defn pprnex | |
| "Print stack-trace; hold the bloat" | |
| [ex] | |
| (let [bloat ["sun." "java." "clojure."]] | |
| (clojure.pprint/pprint |
get latest commit of specific file
git log -n 1 --pretty=oneline -- <file-name.ext> | cut -f 1 -d' ’This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.
Workshop Instructor:
This workshop is distributed under a CC BY-SA 4.0 license.
| https://stackoverflow.com/a/45074641 |
| (def mx1 (comp pprint macroexpand-1)) |
Netcat as web server:
#!/bin/sh
while true; do
echo -e "HTTP/1.1 200 OK\r\n $(cat /var/www/index.html)" |
nc -lp 1500 -q 1
sleep 1
done| (defn test-f | |
| "Tests f on given test cases. | |
| f: function under test | |
| cs: vectors of 2 or 3 where each is: [in-args exp-out eq-op] | |
| with elements: | |
| - in-args: function under test input arguments | |
| - exp-out: expected output | |
| - eq-op: equality operator to apply for expected vs. result comparisson; | |
| if not given, defaults to =" | |
| [f & cs] |