Skip to content

Instantly share code, notes, and snippets.

View floer32's full-sized avatar

Michael Floering floer32

  • 01:09 (UTC -07:00)
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>colorPalette</key>
<dict>
<key>ArchiveExpectationsBarBottomColor</key>
<dict>
<key>a</key>
<real>0.20000000000000001</real>
@floer32
floer32 / ipython_embed_example.py
Last active September 7, 2018 21:40
memo - how to drop into an ipython shell at any time
# -*- coding: utf-8 -*-
if __name__ == "__main__":
# Code code code...
# Code code code...
# Code code code...
from IPython import embed; embed()
@floer32
floer32 / steeef_hangtwenty.zsh_theme
Created October 28, 2016 16:15
steeef zsh theme customized to add return code
# prompt style and colors based on Steve Losh's Prose theme:
# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
#
# vcs_info modifications from Bart Trojanowski's zsh prompt:
# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
#
# git untracked files modification from Brian Carper:
# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
export VIRTUAL_ENV_DISABLE_PROMPT=1
title date description categories tags
Building Borderlands Granular on Ubuntu 12.04 LTS
2012-10-23
music
linux
music
linux
synth
granular

##What Borderlands is

@floer32
floer32 / livecoding-audio-and-visuals.md
Last active May 5, 2016 04:02
Some notes on Livecoding audio and visuals; centerpiece to a workshop at Dadaconf 0.1
@floer32
floer32 / matrix_multiplication_refresher.md
Last active April 13, 2022 11:59
Matrix multiplication refresher: develop your intuition for matrix multiplication! (Or, "matrix multiplication for dummies")

A refresher on matrix multiplication. Because your math classes were years ago. Here's the order I recommend:

  1. TED-Ed video — How to organize, add and multiply matrices - Bill Shillito (only 5 minutes)
  2. betterexplained.com"An Intuitive Guide to Linear Algebra" by Kalid Azad
  3. mathinsight.org: "Matrices and linear transformations"
  4. Read some of the answers on math.stackexchange.com. You've been studying the general definition of matrix multiplication. You may wonder: "Are there other ways to define the product of two matrices?" These resources will answer, yes, there are other ways, but also explain why this general definition is the standard way.
  5. [What is the intuitive way of thinking about multiplication of m
@floer32
floer32 / pytest-doctest-with-coverage.sh
Last active August 21, 2017 03:53
Run pytest with doctests and coverage from doctests AND normal unittests/pytests
# A coworker of mine covinced himself that the built-in pytest doctest support module didn't integrate with pytest-cov.
# He wrote his shim to get around this. Not necessary though.
# The gist is to make sure you have "--doctest-modules" and "--cov-report" and "--cov" arguments.
py.test . --doctest-modules --cov-report term --cov=.
# or
py.test mymodule --doctest-modules --cov-report term --cov=mymodule
@floer32
floer32 / aws_lambda_gotcha.md
Created October 16, 2015 21:21
A gotcha I ran into while playing with AWS Lambda.

I started out pasting Python code into the AWS Lambda web GUI, right in that textarea. Got it working, making a call to a Slack API (whee!). So I had a working test case and I could test a refactor.

With the same code, I wanted to take advantage of the cool zipfile/ virtualenv upload support ("Create a Deployment Package") so I could use third-party libraries. Keeping the code itself the same (same as what I'd pasted into the textarea), the test should work again, as long as I packaged it right.

I kept trying to upload a zip with the same code, I thought, to AWS Lambda ... but I kept getting an error:

@floer32
floer32 / printSystemProperties.java
Created July 16, 2015 23:50
print system properties in Java
Properties p = System.getProperties();
Enumeration keys = p.keys();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
String value = (String)p.get(key);
System.out.println(key + ": " + value);
}
@floer32
floer32 / install_jce_policy_jars.sh
Last active August 29, 2015 14:25
install Java Cryptography Extensions (unlimited JCE)
# ABOUT: https://en.wikipedia.org/wiki/Java_Cryptography_Extension
# AUTHOR: gist.github.com/hangtwenty
# PREREQUISITE:
# Download jce_policy*.zip from Oracle:
# - Java 8: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
# - Java 7: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
unzip $HOME/Downloads/jce_policy*.zip -d $HOME/Downloads/jce_policy_jars
jre_path="$JAVA_HOME/jre"
dest="$jre_path/lib/security"