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 ( | |
"fmt" | |
"net/url" | |
) | |
func main() { | |
u, _ := url.Parse("http://foo.bar?a=b") |
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 ( | |
"fmt" | |
) | |
type String string | |
func (f String) Dasherize() String { |
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 | |
# Script does not handle file names that contain spaces. | |
# It runs all the checks. If any of the checks fails, it doesn't stop, but rather collects all the errors. | |
has_errors=0 | |
# get go files to check against | |
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$' | grep -v 'vendor\/') | |
[ -z "$gofiles" ] && exit 0 |
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 gzip | |
import sys | |
s = """ | |
aaaa | |
""" | |
se = s.encode("utf8") | |
sez = gzip.compress(se) | |
raw_size = len(se) |
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 python3 | |
# usage: ./wget.py link-to-download [interrupt-timeout] | |
import subprocess | |
import sys | |
download_timeout = 60 * 3 # 3 minutes - default | |
if len(sys.argv) < 2: |
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 | |
# Script does not handle file names that contain spaces. | |
# It runs all the checks. If any of the checks fails, it doesn't stop, but rather collects all the errors. | |
has_errors=0 | |
# get go files to check against | |
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$') | |
[ -z "$gofiles" ] && exit 0 |
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
version: '2' | |
services: | |
redis: | |
image: redis:alpine | |
container_name: redis_db | |
command: redis-server --appendonly yes | |
ports: | |
- 6379:6379 | |
volumes: |
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
# Docker image for trpl-ebook 'The Rust Programming Language' as EBook project. | |
# All you need to do is copy this file and build docker image from it and run command cargo run --release in container. | |
FROM scorpil/rust:1.12 | |
RUN apt-get update && \ | |
apt-get install --yes --no-install-recommends \ | |
git \ | |
ca-certificates \ | |
inotify-tools \ |