Skip to content

Instantly share code, notes, and snippets.

Michael Floering hangtwenty

Block or report user

Report or block hangtwenty

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
@hangtwenty
hangtwenty / HOWTO_install_xmobar_with_all_extensions.sh
Last active Mar 6, 2019
HOWTO xmobar with all extensions in Arch Linux
View HOWTO_install_xmobar_with_all_extensions.sh
#!/bin/sh
# install cabal-install if necessary
sudo pacman -S cabal-install
# preparing to install xmobar with all extensions
sudo pacman -S alex
yaourt haskell-language-c-03
sudo cabal install --global c2hs
sudo cabal install --global alsa-mixer
@hangtwenty
hangtwenty / prepareImageGallery
Last active Dec 16, 2015
A little script I used to take all images in a folder and generate two sizes of it - one thumbnail size, one large-but-not-too-large. For use in an online image gallery. This is still raw and could certainly be refactored a bit, but it gets the job done. This script generated the images for the gallery on FloeringPlastering.com. DEPENDS ON Image…
View prepareImageGallery
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# This script walks all images in current directory and all of its subdirectories
# (and so on). Two copies of each image are made, one of the size specified
# by --large and one of the size specified by --thumb. The copies are saved in
# a subdirectory named according to size, adjacent to the original file.
# For example, given the following structure:
#
# my_images/
@hangtwenty
hangtwenty / centos_python_env_setup
Last active Aug 16, 2019 — forked from stantonk/doit
CentOS 6: Install Python 2.7.4, pip, virtualenv, and virtualenvwrapper on CentOS (plus some bonus items at the end if you want). You should probably run with `sudo`.
View centos_python_env_setup
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
@hangtwenty
hangtwenty / centos_cx_Oracle
Last active Jan 6, 2020
CentOS 6: Set up Oracle Instant Client and Python package cx_Oracle
View centos_cx_Oracle
#!/bin/bash
# INSTALL ORACLE INSTANT CLIENT #
#################################
# NOTE: Oracle requires at least 1176 MB of swap (or something around there).
# If you are using CentOS in a VMWare VM, there's a good chance that you don't have enough by default.
# If this describes you and you need to add more swap, see the
# "Adding a Swap File to a CentOS System" section, here:
# http://www.techotopia.com/index.php/Adding_and_Managing_CentOS_Swap_Space
@hangtwenty
hangtwenty / tiny_colored_bash_prompt.sh
Created May 9, 2013
Tiny colored prompt. I don't love it, but I've been using it for a while anyways. Best feature is that it is colorized based on the exit status of the previous command.
View tiny_colored_bash_prompt.sh
#########################################
## Prompt stylization and history sync ##
#########################################
bash_prompt_command() {
# Grab exit status of previous command
RTN=$?
prevCmd=$(prevCmd $RTN)
# Save and reload the history after each command finishes
@hangtwenty
hangtwenty / linux_mint_python_development_environment_setup.sh
Last active May 9, 2017
Linux Mint 14 Python development environment set up. Installs Python 2.7.4, pip, virtualenv, and virtualenvwrapper, and more. If you are executing this whole script, run with `sudo`.
View linux_mint_python_development_environment_setup.sh
sudo apt-get update
# General development essentials
sudo apt-get install -y build-essential ssh git gitk
# Databases: You may not need all of these;
# none are explicit dependencies of other items in this script.
# SQLite and MySQL are pretty generally used for web development,
# and ODBC is just something we use at work.
sudo apt-get install -y sqlite
@hangtwenty
hangtwenty / linux_mint_cx_Oracle.sh
Last active Jun 4, 2018
Linux Mint 14 cx_Oracle and Oracle Instant Client setup.
View linux_mint_cx_Oracle.sh
#!/bin/bash
# SPECIFY THE VIRTUALENV YOU WANT TO INSTALL cx_Oracle TO #
###########################################################
# Change this to whatever you want, but note that this script isn't going to make the virtualenv for you.
# It assumes the environment already exists.
MY_VIRTUAL_ENV='dynamic'
# INSTALL ORACLE INSTANT CLIENT'S DEPENDENCIES #
@hangtwenty
hangtwenty / tupperware.py
Last active Nov 18, 2019
recursively convert nested dicts to nested namedtuples, giving you something like immutable object literals
View tupperware.py
from UserDict import IterableUserDict
import collections
__author__ = 'github.com/hangtwenty'
def tupperware(mapping):
""" Convert mappings to 'tupperwares' recursively.
@hangtwenty
hangtwenty / logging_subprocess.py
Last active Dec 22, 2015 — forked from bgreenlee/logging_subprocess.py
Variant of subprocess.call that accepts a logger instead of stdout/stderr
View logging_subprocess.py
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.
View veracode_hackathon_for_kids_scratch_resources.md

Written with StackEdit.

Scratch Programming Activities

For the Veracode HacKIDthon

Ordered by level of difficulty and probably age or experience of student, beginning with the easiest.

You can’t perform that action at this time.