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
| 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() | |
| ``` |
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
| #!/usr/bin/env/python2 | |
| # coding: utf-8 | |
| import requests | |
| import json | |
| import appex | |
| import dialogs | |
| import re | |
| import datetime | |
| import keychain |
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
| # coding: utf-8 | |
| # This script downloads and opens a Gist from a URL in the clipboard. | |
| # It's meant to be put in the editor's actions menu. | |
| # | |
| # It works with "raw" and "web" gist URLs, but not with gists that | |
| # contain multiple files or non-Python files. | |
| # | |
| # If a file already exists, a dialog is shown that asks whether the | |
| # new file should be renamed or replaced. |
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/sh | |
| # Usage: convert_gpx.sh <FIT filename> | |
| # Should works whether you include the .FIT extension or not. | |
| filename=$(basename "$1" .FIT) | |
| gpsbabel -i garmin_fit -f "$filename".FIT -o gpx -F "$filename".gpx |
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 ( | |
| logging "github.com/op/go-logging" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "testing" | |
| ) |
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 | |
| set -o errexit | |
| echo "Removing exited docker containers..." | |
| docker ps -a -f status=exited -q | xargs -r docker rm -v | |
| echo "Removing dangling images..." | |
| docker images --no-trunc -q -f dangling=true | xargs -r docker rmi |
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 | |
| # Go build script that runs cloc, cpd, lint, vet, test and coverage for Jenkins | |
| # | |
| # Outside tools include: | |
| # gocov: go get github.com/axw/gocov | |
| # gocov-xml: go get github.com/t-yuki/gocov-xml | |
| # go2xunit: go get bitbucket.org/tebeka/go2xunit | |
| # jscpd: npm i jscpd -g | |
| # cloc: npm i cloc -g |
A Go version of The Perl Cookbook
The Perl part is copyrighted by O'Reilly & Associates yet freely available.
This copy is based on http://pleac.sourceforge.net/pleac_perl.data
- Modify index.txt with your output path and proxy info
- Use Text Builder to build configuration for Surge:
$ text-builder -index /path/to/index.txtOr run$ sh build-allto build all your index files. - Import configuration via AirDrop/iTunes/Dropbox/iCloud
本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.