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
set ( QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR} ) | |
# version | |
set ( _VERSION_FILE ${QWT_INCLUDE_DIR}/qwt_global.h ) | |
if ( EXISTS ${_VERSION_FILE} ) | |
file ( STRINGS ${_VERSION_FILE} _VERSION_LINE REGEX "define[ ]+QWT_VERSION_STR" ) | |
if ( _VERSION_LINE ) | |
string ( REGEX REPLACE ".*define[ ]+QWT_VERSION_STR[ ]+\"([^\"]*)\".*" "\\1" QWT_VERSION_STRING "${_VERSION_LINE}" ) | |
endif () | |
endif () |
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
bootstrap: docker | |
from: ubuntu:18.04 | |
%help | |
This will run MultiBUGS | |
%environment | |
export PATH=/opt/multibugs:${PATH} | |
%post |
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/awk | |
BEGIN { | |
FS = "\t" | |
} | |
{ | |
if (NF-1 > 0) { | |
print "has tab" | |
} | |
} | |
{ exit 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
import argparse | |
import sys | |
parser = argparse.ArgumentParser() | |
action1 = parser.add_argument('--user', help="username") | |
action2 = parser.add_argument('--bar', | |
help="Only use this if --user is set") | |
action3 = parser.add_argument('--bar2', | |
help="Only use this if --user is set") | |
argv = set(sys.argv) |
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 operator | |
import itertools | |
def contiguous_range(data): | |
""" determine continguous ranges of integer data """ | |
cr_data = [] | |
for k, g in itertools.groupby(enumerate(data), lambda (i,x):i-x): | |
cr_data.append(map(operator.itemgetter(1), g)) | |
return cr_data |
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
" https://github.com/tangledhelix/dotfiles/blob/master/vim/plugin/twiddlecase.vim | |
" Toggles between uppercase, lowercase, titlecase. Bind to a mapping, then | |
" select something and keep hitting the map until you get what you want. | |
function! TwiddleCase(str) | |
if a:str ==# toupper(a:str) | |
let result = tolower(a:str) | |
elseif a:str ==# tolower(a:str) | |
let result = substitute(a:str,'\(\<\w\+\>\)', '\u\1', 'g') | |
else |
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
us_states = [ | |
'Alabama', | |
'Alaska', | |
'Arizona', | |
'Arkansas', | |
'California', | |
'Colorado', | |
'Connecticut', | |
'Delaware', | |
'Florida', |
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
# argparse section | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--email", help="send to specific email") | |
parser.add_argument("--console", action="store_true", default=False, help="push results to stdout") | |
# grab the options here from the command line, console overrides email | |
args = parser.parse_args() |
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
# reference http://stackoverflow.com/a/9728478/992834 | |
import os | |
def list_files(startpath): | |
for root, dirs, files in os.walk(startpath): | |
level = root.replace(startpath, '').count(os.sep) | |
indent = ' ' * 4 * (level) | |
print('{}{}/'.format(indent, os.path.basename(root))) | |
subindent = ' ' * 4 * (level + 1) |