- Download the latest zsh package: https://packages.msys2.org/package/zsh?repo=msys&variant=x86_64
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
This is a considerably faster, but much more basic alternative to bash-git-prompt.
When adding this script to your .bash_profile or .bashrc, it'll display the selected branch of the current folder (if it's a git repo), and whether it's modified (yellow) or contains staged files (cyan).
The script makes the assumption, that a .git folder only exists when the directory is a git repo. Also, it checks for the english version of the git status command, so if you're using git in a different locale, make sure to adjust this.
| // https://medium.com/@mlowicki/http-s-proxy-in-golang-in-less-than-100-lines-of-code-6a51c2f2c38c | |
| // #!/usr/bin/env bash | |
| // case `uname -s` in | |
| // Linux*) sslConfig=/etc/ssl/openssl.cnf;; | |
| // Darwin*) sslConfig=/System/Library/OpenSSL/openssl.cnf;; | |
| // esac | |
| // openssl req \ | |
| // -newkey rsa:2048 \ | |
| // -x509 \ |
| // some updates for https://rsmitty.github.io/Kubernetes-Events/ | |
| // and http://blog.ctaggart.com/2016/09/accessing-kubernetes-api-on-google.html | |
| import ( | |
| "encoding/base64" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "time" |
| #! /usr/bin/env bash | |
| # Create the container with a long running process. If PID1 exists before | |
| # we send the exec commands, they will fail because the container is not running | |
| # | |
| CONTAINER_NAME="TEST-`uuidgen`" | |
| curl --silent --unix-socket /var/run/docker.sock "http:/containers/create?name=${CONTAINER_NAME}" -XPOST \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "Image": "ruby:latest", |
| #!/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import time | |
| import logging | |
| from logging.handlers import TimedRotatingFileHandler | |
| LOG_DIR = "/tmp/" |
| #! /usr/bin/env python3 | |
| import asyncio | |
| import contextlib | |
| async def ping(ip): | |
| p = await asyncio.create_subprocess_exec('ping', '-c', '4', ip, stdout=asyncio.subprocess.PIPE) | |
| async for line in p.stdout: | |
| print(line) |
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { | |
| http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev