Skip to content

Instantly share code, notes, and snippets.

View floer32's full-sized avatar

Michael Floering floer32

  • 12:27 (UTC -07:00)
View GitHub Profile
@floer32
floer32 / centos_python_env_setup
Last active May 2, 2022 03:47 — 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`.
#!/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
@floer32
floer32 / logging_subprocess.py
Last active December 22, 2015 00:39 — forked from bgreenlee/logging_subprocess.py
Variant of subprocess.call that accepts a logger instead of stdout/stderr
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.
@floer32
floer32 / remove_punc.py
Last active September 21, 2019 21:12 — forked from kissgyorgy/remove_punc.py
Python: Remove punctuation from string (quickly)
#http://stackoverflow.com/questions/265960/best-way-to-strip-punctuation-from-a-string-in-python
import re, string
table = string.maketrans("","")
regex = re.compile('[%s]' % re.escape(string.punctuation))
def test_re(s): # From Vinko's solution, with fix.
return regex.sub('', s)
def test_trans(s):
@floer32
floer32 / owasp-risk-rating.html
Created September 20, 2017 15:13 — forked from ErosLever/owasp-risk-rating.html
This is a quick and dirty OWASP Risk Rating Calculator. (demo: https://tinyurl.com/OwaspCalc )
<!-- access this at: https://cdn.rawgit.com/ErosLever/f72bc0750af4d2e75c3a/raw/owasp-risk-rating.html -->
<html><head>
<style>
#main{
width: 1200px;
}
table {
width: 98%;
font-size: small;
text-align: center;
@floer32
floer32 / stash_dropped.md
Last active October 9, 2019 23:00 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits:

git log --graph --oneline --decorate $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

Aligning images

left alignment

This is the code you need to align images to the left:

@floer32
floer32 / master.vim
Last active February 9, 2021 17:45 — forked from gmccreight/master.vim
Shortened fork of master.vim, which is "a script that gives you a playground for mastering vim." I learned via vim-adventures.com originally (highly recommend!) but this was good too. I removed sections I don't use, because I use vim keybindings inside other editors (and prefer the editors' functionality for anything "fancy")
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)