This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
from argparse import ArgumentParser | |
import sys | |
def parseArg(): | |
'''parse command line arguments''' | |
parser = ArgumentParser() | |
parser.add_argument('-i', '--input', dest='input', metavar='INPUT',\ | |
type=file, default=sys.stdin, help='Full input file') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# index icon dir file.zim | |
abspath(){ #{{{ | |
local thePath | |
if [[ ! "$1" =~ ^/ ]];then | |
thePath="$PWD/$1" | |
else | |
thePath="$1" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ ! -f "$1" ]] && exit 1 | |
dmgfile="$1" | |
while read a b c;do | |
eval mp='$c' | |
done < <(hdiutil mount -noautofsck -noverify -noautoopen "$dmgfile"||exit 1) | |
echo Step 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get absolute path(shell) | |
abspath(){ #{{{ | |
local thePath | |
if [[ ! "$1" =~ ^/ ]];then | |
thePath="$PWD/$1" | |
else | |
thePath="$1" | |
fi | |
IFS=/ parr=($thePath) | |
declare -a outp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
import plistlib as plib | |
import subprocess as subp | |
from contextlib import closing | |
import os, tempfile, shutil, re | |
from NameAppend import nameAppend | |
def parsePlistToString(plistFile=None): | |
'''parsePlistToString(plistFile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
from PyQt4.QtCore import SIGNAL, pyqtSignal, QObject, QString | |
from PyQt4.QtGui import (QApplication, QDialog, | |
QTextBrowser, QPushButton, QVBoxLayout, | |
QLineEdit, QGridLayout, QTextCursor, | |
QLabel, QHBoxLayout, QFileDialog, | |
QCheckBox , QSizePolicy , QSpacerItem, | |
QGroupBox, QComboBox, QSpinBox) | |
import sys,os,re | |
import subprocess as subp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt4.QtGui import QPixmap, QApplication | |
import os | |
namebase='screenshit_' | |
num=1 | |
outdir= os.path.abspath(os.path.join(os.environ['HOMEPATH'],'Documents')) | |
while os.path.exists(os.path.join(outdir,namebase+str(num)+'.png')): | |
num+=1 | |
fulloutname = os.path.join(outdir, namebase + str(num) + '.png') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpv() { | |
if ! type -P pv >/dev/null;then | |
echo need pv >&2 | |
return 1 | |
fi | |
case $# in | |
0|1) | |
echo invalid arguments >&2 | |
return 1 | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
from optparse import OptionParser | |
from subprocess import call | |
import os.path | |
import os | |
import tempfile | |
img_max_width_or_height = 256 |