I use this little function (repo
) on the command line to allow me to switch between different repositories easily using fzf
- fzf
- zsh or bash
# Adapted from https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile | |
# Install dependencies only when needed | |
FROM node:16-alpine AS deps | |
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
RUN npm ci | |
# Rebuild the source code only when needed |
[alias] | |
lg = !"git lg1" | |
lg1 = !"git lg1-specific --all" | |
lg2 = !"git lg2-specific --all" | |
lg3 = !"git lg3-specific --all" | |
rms = !"git rm --cached $(git ls-files --deleted)" | |
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' | |
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' | |
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)' |
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: dns-sync | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: S | |
# Default-Stop: | |
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks | |
### END INIT INFO |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
# chpwd is a zsh hook, wich is executed after change directory | |
# More info: http://zsh.sourceforge.net/Doc/Release/Functions.html | |
function chpwd() { | |
if [ -z "$VIRTUAL_ENV" ]; then | |
# If exists a virtualenv with name of directory, load it! | |
workon ${PWD##*/} 2> /dev/null | |
else | |
# If a virtual env are loaded, rename window with they name | |
TMUX_WINDOW_NAME=$(tmux display-message -p '#W') | |
if [ $TMUX_WINDOW_NAME != ${VIRTUAL_ENV##*/} ]; then |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#################################################################### | |
# | |
# All Code and Comments Below (except code provided by Boris Mayer) are | |
# Copyright Marc Schwartz | |
# e-mail: marc_schwartz@me.com | |
# This code is made available under the GNU Public License V2.0 | |
# This is free software and comes with ABSOLUTELY NO WARRANTY. | |
# | |
#################################################################### |
Simplest intro to git by github and codeschool - Try Git
[Intro to github]