Skip to content

Instantly share code, notes, and snippets.

@pabranch
pabranch / git-stop-tracking-remote-branch.md
Created July 13, 2018 23:52 — forked from magnusbae/git-stop-tracking-remote-branch.md
How to make Git stop track a remote branch without deleting the remote branch.

You don't have to delete your local branch.

Simply delete your remote tracking branch:

git branch -d -r origin/<remote branch name> (This will not delete the branch on the remote repo!)

See "Having a hard time understanding git-fetch"

there's no such concept of local tracking branches, only remote tracking branches.

@pabranch
pabranch / HowToOTGFast.md
Created August 15, 2017 14:07 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH is

@pabranch
pabranch / properties-expander.sh
Created January 3, 2017 17:55 — forked from emmanuelbernard/properties-expander.sh
Expand properties in bash
#!/bin/bash
#
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
# Copyright (c) 2012 Emmanuel Bernard
# -----
# Usage: properties-expander.sh <properties file> <template> <destination>
#
# Properties file:
# PROPERTY1=value1
# PROPERTY2=value2
@pabranch
pabranch / gist:c16706584f1d46a45b45b7df74d43680
Last active December 6, 2016 22:15 — forked from blalor/gist:5527096
redhat → debian, arch rosetta stone
rpm yum debian arch
rpm -i foo.rpm dpkg -i foo.deb pacman -U foo.pkg.tar.xz
yum install foo apt-get install foo pacman -S foo
rpm -e foo yum remove foo dpkg -P foo pacman -R foo
rpm -qip foo.rpm dpkg -I foo.deb pacman -Qi -p foo.pkg.tar.xz
yum info foo apt-cache show foo pacman -Si foo
rpm -qlp foo.rpm dpkg -c foo.deb pacman -Ql -p foo.pkg.tar.xz
rpm -ql foo

TodoMVC React

@pabranch
pabranch / rot.py
Created March 21, 2016 22:21 — forked from terrorbyte/rot.py
Classic ROT substitution cipher in python, with a twist. Supports ROT13, ROT47, ROT 0x8000 (UTF-8 version), ROT 0x80000 (UTF-16), and Frobnicate (XOR with 42 used in Linux memfrob).
#!/bin/env python
import argparse
#bin(ord(u'联'))
#chr(0b1000000001010100)
#bin(ord(u'联') ^ 0x8000)
#bin(ord(u'T') ^ 0x8000)
#Frobnicate a string
def frobnicate(s):
#!/bin/sh
#
# Example showing use of getopt detection and use of GNU enhanced getopt
# to handle arguments containing whitespace.
#
# Written in 2004 by Hoylen Sue <hoylen@hoylen.com>
#
# To the extent possible under law, the author(s) have dedicated all copyright and
# related and neighboring rights to this software to the public domain worldwide.
# This software is distributed without any warranty.

update

I've created a little repository that simply exposes the final utility as npm module.

It's called html-escaper


there is basically one rule only: do not ever replace one char after another if you are transforming a string into another.

#!/bin/bash
# git-branch-status - this script prints out pretty git branch sync status reports
# * originally by http://github.com/jehiah
# * "s'all good!" message by http://github.com/kd35a
# * ANSI colors by http://github.com/knovoselic
# * formatting, filters, usage, and remotes by http://github.com/bill-auger
read -r -d '' USAGE <<-'USAGE'
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for vbox domain
# ----------------------
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/vbox'