As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
github recently switched to an https scheme as the default for cloning repos. as a side effect you may suddenly be prompted for a 'Username' and 'Password' when you push where, previously, you were able to do so without typing in credentials. the solution is to cause git to cache https credentials which is easy, since git uses curl under the covers
in your home directory create a file called '.netrc', for example
/Users/ahoward/.netrc
in it put these contents
# -*- coding: utf-8 -*- | |
import json | |
import sys | |
from ConfigParser import (ConfigParser, MissingSectionHeaderError, | |
ParsingError, DEFAULTSECT) | |
class StrictConfigParser(ConfigParser): | |
def _read(self, fp, fpname): |
#!/bin/sh | |
# This is the path to the Google Authenticator app file. It's typically located | |
# in /data under Android. Copy it to your PC in a safe location and specify the | |
# path to it here. | |
DB="/path/to/com.google.android.apps.authenticator/databases/databases" | |
sqlite3 "$DB" 'SELECT email,secret FROM accounts;' | while read A | |
do | |
NAME=`echo "$A" | cut -d '|' -f 1` |
<?php | |
if(class_exists('MeprUtils')) { | |
$user = MeprUtils::get_currentuserinfo(); | |
if($user !== false && isset($user->ID)) { | |
//Returns an array of Membership ID's that the current user is active on | |
//Can also use 'products' or 'transactions' as the argument type | |
$active_prodcuts = $user->active_product_subscriptions('ids'); | |
if(!empty($active_prodcuts)) { |
#! /usr/bin/env python3 | |
""" | |
List all Firefox tabs with title and URL | |
Supported input: json or jsonlz4 recovery files | |
Default output: title (URL) | |
Output format can be specified as argument | |
""" |
#!/usr/bin/env python3 | |
import fileinput | |
import re | |
from colorsys import * | |
def rgb_to_hsl(r, g, b): | |
return hsv_to_hsl(*rgb_to_hsv(r, g, b)) | |
def hsl_to_rgb(h, s, l): | |
return hsv_to_rgb(*hsl_to_hsv(h, s, l)) |
# Run the last command as root | |
sudo !! | |
# Serve current directory tree at http://$HOSTNAME:8000/ | |
python -m SimpleHTTPServer | |
# Save a file you edited in vim without the needed permissions | |
:w !sudo tee % | |
# change to the previous working directory | |
cd - | |
# Runs previous command but replacing | |
^foo^bar |