Skip to content

Instantly share code, notes, and snippets.

Henry Schreiner henryiii

Block or report user

Report or block henryiii

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@henryiii
henryiii / bstemplate.bash
Last active Dec 18, 2015
Bash Script Template, copy useful parts.
View bstemplate.bash
#!/usr/bin/env bash
# No argument version (any argument prints help)
if [ $# -gt 0 ] ; then
echo "$(echo $0 | sed "s;$HOME;~;")"
echo "Help command output"
exit 0
fi
@henryiii
henryiii / pstemplate.py
Created Jun 22, 2013
Python Script Template, copy useful parts.
View pstemplate.py
#!/usr/bin/env python
import argparse
import os
DIR = os.path.realpath(__file__)
parser = argparse.ArgumentParser(description='Send files to web server')
parser.add_argument('-n', '--nochange',
help='make a dry run, don\'t send anything',
@henryiii
henryiii / git-all.bash
Last active Jul 18, 2019
Fast repository status for repos in git folder
View git-all.bash
#!/usr/bin/env bash
# This script should be named (or symbolically linked) as git-all so that
# it can be run as a git command (if it is in the path). The repo location should
# be set in REPOLOC. Can be relative if this script is also in a repo!
# Standard bash stuff to get the current directory
unset CDPATH
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
View gist:6274508
#!\usr\bin\env python
from PyQt4 import QtCore, QtGui, uic
import sys
import os
Slot = QtCore.pyqtSlot
Signal = QtCore.pyqtSignal
LoadUI = uic.loadUi
if getattr(sys, 'frozen', None):
View installsympy.py
# Install SimPy
import urllib
import tarfile
import shutil
import console
import os
name = 'sympy'
version = '0.7.5'
View iDG.py
import ui
import console
#from DetGUI.connection import Detector
sz = ui.get_screen_size()
banner = 108
class MyTextFieldDelegate (object):
def __init__(self,but):
self.but = but
@henryiii
henryiii / uidir.py
Last active Aug 29, 2015
directory viewer for ui
View uidir.py
# coding: utf-8
import ui
import os
import console
class MyTableViewDataSource (object):
sel = [None]
def __init__(self, base_dir = '.'):
@henryiii
henryiii / h2048.py
Last active Aug 29, 2015
Pythonista 2048 clone, using ui module. Also should work in any Python console. Added jsbain's swipe implementation.
View h2048.py
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 12 09:33:29 2014
@author: henryiii
Added improvents by JonB (swipes), techteej (design), LawAbidingCactus (size)
"""
import console, random
@henryiii
henryiii / textmanipui.py
Created Jul 16, 2014
UI powered text manipulation
View textmanipui.py
# perform actions on a selected block of text
import editor
import ui
sel = editor.get_selection()
text = editor.get_text()
if sel[0]-sel[1]:
text = text[sel[0]:sel[1]]
@henryiii
henryiii / cards.py
Last active Aug 29, 2015
base for card games
View cards.py
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 20 17:27:33 2014
@author: henryiii
"""
# http://en.wikipedia.org/wiki/Playing_cards_in_Unicode
from __future__ import unicode_literals, division
You can’t perform that action at this time.