— C++/Cinder TouchDesigner TOP

Compiling the Cinder C++ library as a TouchDesigner Texture Operator (TOP)

source github.com/quilime/Cinder-TouchDesigner-TOP

built with

  • TouchDesigner v77
  • Visual Studio 2010
  • Windows 7

more...

— Generate Semitones

# python
m = 2 ** (1/12)
for s in range(13):
    print(int(0.5 + 1000 * m ** s - 1000))
# output
semitone - fine
0  - 0
1  - 59
2  - 122
3  - 189
4  - 260
5  - 335
6  - 414
7  - 498
8  - 587
9  - 682
10 - 782
11 - 888
12 - 1000

more...

— count words in html file with python

Count the words in a html file from a given URL using NTLK.

Gist on Github.

#!/usr/bin/python

import nltk
import string
from urllib import urlopen
from itertools import imap

url = "http://google.com"
html = urlopen(url).read()
text = nltk.clean_html(html)
text_noPunc = text.translate(string.maketrans("",""), string.punctuation)
words = text_noPunc.split()
max_word_len = max(imap(len, words))
vocabulary = nltk.probability.FreqDist(words)

for word in vocabulary:
    print word,
    print ' ' * (max_word_len + 5 - word.__len__()),
    print str(vocabulary[word])

more...

— DualBoot Archlinux/Windows7 Installation

Documentation of the process of installing archlinux and Windows 7 in a dual-boot configuration circa 2012.

more...

— print formatted JSON, XML from MacOS command line

Working with various interfaces that output json or xml results in lots of situations where you have a single-line, unformatted output. Here’s a quick way to format json, xml from the CLI using Python or jq.

more...

— command line audio on OSX

Since there is no equivilent to /dev/dsp or /dev/audio on OSX, you need to install an alternative like sox.

Install sox by either downloading the OSX binary from http://sox.sourceforge.net/ or install homebrew, and then install sox with brew install sox

more...

— command history

history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head

more...

— Terminal Emulator on Windows via Cygwin

How to install cygwin on windows circa 2011.

Install Cygwin from setup.exe

Install the following packages

  • xorg-server (required, the Cygwin X Server)
  • xinit (required, scripts for starting the X server: xinit, startx, startwin (and a shortcut on the Start Menu to run it), startxdmcp.bat )
  • xorg-docs (optional, man pages)
  • X-start-menu-icons (optional, adds shortcuts to X Clients and Server to the Start menu)
  • mintty (windows-feel terminal)

Optional Packages

  • openssh
  • git, svn
  • wget, curl
  • rsync
  • vim, emacs
  • any additional fonts

more...

— flash usb stick w/bootable iso

  1. diskutil list
    Determines the device node assigned to your flash media (e.g. /dev/disk2)

  2. diskutil unmountDisk /dev/disk#
    Replace # with the disk number from the last command; in the previous example, # is 2)

  3. sudo dd if=/path/to/example.iso of=/dev/diskN bs=1m
    Replace /path/to/example.iso with the path to the iso; for example: ./windows7.iso. After typing in your sudo password, the process will start invisibly.

  4. diskutil eject /dev/disk#
    Remove your flash media device when the command completes. Done!

Referenced from BurningIsoHowto

Bonus tip! You want to see how far the dd copy is coming along? Run in another terminal instance:
$ sudo killall -INFO dd
The process info will display in the original terminal.

more...

— PHP File Browser Scripts

These scripts offer some handy features for browsing files/folders on a webserver.

Source on GitHub.

more...