moved to https://github.com/hangtwenty/dadaconf-livecoding-guide
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
class EasyReprMixin(object): | |
""" A mixin that gives an OK default for `__repr__`. | |
I mix this into classes with instances that are static after creation, | |
i.e. with properties telling you about their contents. Wrappers for | |
data usually. | |
""" | |
def __repr__(self): | |
attributes = [ |
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
""" Functions to "multiply" sequences in peculiar way. Intended for use in generating sets harmonic frequencies. | |
.. moduleauthor:: hangtwenty | |
A friend of mine was wondering how to do something like this so I just had fun coming up with a solution. | |
I may use it in Supercollider or something if I can figure out how to glue Python and SC together. | |
""" | |
def flat_product_of_sequences(seq1, seq2): | |
""" Given two flat lists of integers, return this program's particular kind of product of them. |
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
# 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" |
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
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); | |
} |
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/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/ |
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
######################################### | |
## 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 |
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 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. |
title | date | description | categories | tags | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Building Borderlands Granular on Ubuntu 12.04 LTS |
2012-10-23 |
|
|
##What Borderlands is
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
<?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> |
OlderNewer