Tmux stands for Terminal Multiplexer. It allows you to run multiple programs in the same terminal, detach from the terminal (while the programs continue to run) and re attach from a different terminal.
tmux
import pyinotify | |
import asyncio | |
class EventHandler(pyinotify.ProcessEvent): | |
def process_IN_CREATE(self, event): | |
if not event.dir: | |
print("Got new file: ", event.pathname) | |
wm = pyinotify.WatchManager() # Watch Manager |
Time Sum Command | |
1133 5053 > builtin source /usr/local/Cellar/fish/3.0.2/share/fish/config.fish | |
50 50 -> set -g IFS \n\ \t | |
23 23 -> set -qg __fish_added_user_paths | |
19 19 -> set -g __fish_added_user_paths | |
17 17 -> function __fish_default_command_not_found_handler | |
printf "fish: Unknown command %s\n" (string escape -- $argv[1]) >&2 | |
... | |
9 425 -> if status --is-interactive | |
# The user has seemingly explicitly launched an old fish with too-new scripts installed. |
" Spaces and indent | |
set expandtab " tabs are spaces | |
set shiftwidth=4 " size of indents in spaces | |
set softtabstop=4 " simulate tabs with this many spaces | |
" FileType specific tab overrides | |
filetype plugin indent on " Enable filetype detection and <filetype>.vim loading | |
autocmd FileType html setlocal shiftwidth=2 tabstop=2 | |
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 | |
autocmd FileType vue setlocal shiftwidth=2 tabstop=2 |
""" | |
Point must be in srid 4326 (Mercator projection) | |
Based on http://lists.osgeo.org/pipermail/postgis-users/2005-December/010204.html | |
""" | |
def point_to_srid(lat, lng): | |
if lat > 0: | |
base_srid = 32600 # northern hemisphere | |
else: | |
base_srid = 32700 |
0x7b8c37aE8B1ea33962D6ee08cA912670357092Ff |
import random | |
""" | |
My 'probably good enough' implementation of the ponysort. | |
Create enough buckets (rakes) for each rider. Iterate over the | |
riders and only add a rider to a rake if it is not already | |
there. Does not attempt to optimize spacing. | |
There is a case where the callup can not be created: if a rider | |
appears more than NUM_RIDERS/RAKE_SIZE times. |
import urllib, urllib2, subprocess, re, csv, pickle | |
from collections import OrderedDict | |
urls = [] | |
usessl = 0 | |
sites = OrderedDict() | |
CHECK = 1000 | |
with open('top-1m.csv', 'rb') as csvfile: | |
i = 0 | |
reader = csv.reader(csvfile) |
#!/bin/bash | |
#Converts images to text using tesseract (package tesseract-ocr & tesseract-ocr-eng) | |
function usage | |
{ | |
echo "img2txt -i <input directory> -o <output directory> --concat" | |
} | |
function concat | |
{ |
#!/usr/bin/python | |
import urllib2 | |
import urllib | |
import re | |
import getopt, sys, argparse | |
def getSongLyrics(artist, song): | |
songUrl = 'http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=%s&song=%s' % (urllib.quote_plus(artist), urllib.quote_plus(song)) | |
data = urllib2.urlopen(songUrl).read(); | |
p = re.compile('<Lyric>[a-zA-z].*?<\/Lyric>', re.DOTALL) |