Skip to content

Instantly share code, notes, and snippets.

View timpulver's full-sized avatar

Tim Pulver timpulver

View GitHub Profile
@timpulver
timpulver / rotateImage.pde
Created October 17, 2012 14:46
[Processing] Rotate Image using a direction vector
/**
* Rotates an image around an angle
* For this the direction vector dir will be used.
* E.g. if you want to code something like Asteroids:
* A rocket, which is always pointing towards the direction it is flying to...
* For details about atan2 see here: http://www.processing.org/reference/atan2_.html
*
* keywords: atan, atan2, sin, cos, tan, vector, vektor, math, mathe, winkel,
* angle, rotation, processing.org, 360, TWO_PI, origin, ursprung, image, bild
*/
@timpulver
timpulver / ResizableSketch.pde
Created November 24, 2012 15:21
[Processing] Make window/frame resizable
void setup(){
frame.setResizable(true);
//...
}
// tags: processing, p5, frame, java, resize, window
@timpulver
timpulver / writeToFile.sh
Created November 29, 2012 00:09
[Bash] Write text to file
echo "THIS IS STUFF FOR THE FILE" > index.html
the single > just overwrites anything in there.
echo "THIS IS STUFF FOR THE FILE" >> index.html
the dual >> appends the stuff at the end.
@timpulver
timpulver / IntersectionWithBlend.pde
Created December 4, 2012 15:23
[Processing] Graphical intersection ellipse
/*
* Copied from: Stack Overflow user V.K. http://stackoverflow.com/users/1690199/v-k
* Tags: Intersection, ellipse, blend, intersect, difference, overlap, overlapping
*
*/
PGraphics c;
PGraphics d;
void setup() {
size(300, 300);
@timpulver
timpulver / openGl_with_Processing_2.0_in_Eclipse.txt
Created December 5, 2012 16:29
[Processing, Eclipse] Using OpenGL in Eclipse with Processing 2.0
// Copied from Processing.org Forum user voodoc
I had a hard time finding the answer for this, so I thought I would put this here.
1. Create new Java Project.
2. Create a new folder in you project folder named "lib".
3. Right click "lib" and import all of the files contained in: \ Processing_2.0b3 \ core \ library.
4. Shift click three jar's: core.jar, gluegen-rt.jar, & jogl-all.jar.
5. Right click one of the selected files and go to "Build Path" and then "Add to Build Path".
6. Right click on one of the new .jar's in your build path above, and go to "Build Path" and then "Configure Build Path".
7. In this menu, expand both gluegen-rt.jar and jogl-all.jar.
@timpulver
timpulver / GetNameAndTitleOfActiveWindow.scpt
Created February 11, 2013 10:38
[AppleScript] Get Name of active window | Returns the name / title of the active (frontmost) window
# taken from user Albert's answer on StackOverflow
# http://stackoverflow.com/questions/5292204/macosx-get-foremost-window-title
# tested on Mac OS X 10.7.5
global frontApp, frontAppName, windowTitle
set windowTitle to ""
tell application "System Events"
set frontApp to first application process whose frontmost is true
set frontAppName to name of frontApp
@timpulver
timpulver / photo_journal.md
Created February 27, 2013 15:29
[dayone_export] Jinja2 style template for dayone_export (https://github.com/nathan11g/dayone_export/blob/master/dayone_export/templates/default.html), a tool for exporting day one journals to markdown / html / plain text. This template can be used to export day one journals to markdown format including photos / images. Place the template in your…

#Journal Entries

{% for entry in journal %} ##{{ entry['Date'] | format }}

{% if entry.place() %} {{ entry.place() }}, {% endif %} {{ entry['Date'] | format('%-I:%M %p %Z') }} {% if 'Photo' in entry %}

@timpulver
timpulver / Typografie_Shortcuts_Mac_Deutsch.md
Last active May 7, 2023 18:47
Typografie Shortcuts auf dem Mac mit kurzen Erläuterungen (deutsches Tastaturlayout)
@timpulver
timpulver / dayonebac
Created April 15, 2013 08:12
[Dayone, Backup Script] Creates a zipped backup of your Day One journal including all your photos. Journal will be exported as markdown-file, which can be edited in a plain text editor, and html.
#! /bin/bash
# dayonebac
# v.1.1
# Tim Pulver 2013
#
# dayonebac calls dayone_export, which needs to be installed, too.
# Download it from here: https://github.com/nathan11g/dayone_export
# place this file in /usr/local/bin and make it executable using
# chmod +x dayonebac
@timpulver
timpulver / getkey.sh
Last active December 18, 2015 02:39
This is a helper script for Yate, which calls the application KeyFinder to analyse the musical key of a track and return it. If you set up custom key codes (Camelot system) in KeyFinder, these will also be returned.
#!/bin/bash
# getkey.sh – Musical Key Analysis
#
# This is a helper script for Yate, which calls the application
# KeyFinder to analyse the musical key of a track and return it.
# If you set up custom key codes (Camelot system) in KeyFinder,
# these will also be returned.
#
# Download KeyFinder here: http://www.ibrahimshaath.co.uk/keyfinder/