Skip to content

Instantly share code, notes, and snippets.

View raphaelschaad's full-sized avatar

Raphael Schaad raphaelschaad

View GitHub Profile
@raphaelschaad
raphaelschaad / ThisServiceLEO.rb
Last active September 26, 2015 04:08
I created a systemwide OS X service bound to ⇧⌘1 to translate GER-ENG with this ThisService http://wafflesoftware.net/thisservice/ script.
#!/usr/bin/env ruby
# ThisService Ruby service script example
# Service type: Acts on input.
# Revision 1.
# Unicode considerations:
# Set $KCODE to 'u'. This makes STDIN and STDOUT both act as containing UTF-8.
$KCODE = 'u'
@raphaelschaad
raphaelschaad / RSTimingFunction.h
Last active March 21, 2023 08:40
All the cool animation curves from `CAMediaTimingFunction` but not limited to use with CoreAnimation. See what you can do with cubic Bezier curves here: http://netcetera.org/camtf-playground.html To get started just "Download Gist", throw the .h and .m files into your Xcode project and you're good to go!
//
// RSTimingFunction.h
//
// Created by Raphael Schaad on 2013-09-28.
// This is free and unencumbered software released into the public domain.
//
#import <UIKit/UIKit.h>
@raphaelschaad
raphaelschaad / RSPlayPauseButton.h
Last active July 25, 2016 21:44
Edit: this Gist has now a proper repo and even a CocoaPod: https://github.com/raphaelschaad/RSPlayPauseButton
//
// RSPlayPauseButton.h
//
// Created by Raphael Schaad on 2014-03-22.
// This is free and unencumbered software released into the public domain.
//
#import <UIKit/UIKit.h>
//
// att44_arduino_schaad1.ino
//
// Created by Raphael Schaad on 2015-11-03.
// This is free and unencumbered software released into the public domain.
//
// Hardware:
// Based on Neil Gershenfeld's board: http://academy.cba.mit.edu/classes/embedded_programming/index.html#echo
// With my redesign and enhancements: http://fab.cba.mit.edu/classes/863.15/section.CBA/people/Schaad/week6-electronics-design.html
//
// att44_schaad1.c
//
// Created by Raphael Schaad on 2015-11-03.
// This is free and unencumbered software released into the public domain.
//
// Import headers installed with CrossPack-AVR (/usr/local/CrossPack-AVR/)
#include "stdbool.h" // So we have 'true' and 'false' instead of 1 and 0 (might have memory implications) -- lib/gcc/avr/4.8.1/include/
#include <avr/io.h> // Umbrella header including e.g. iotn44a.h for our chip, defining PORTx/DDRx/Pxn etc. (mapping to addresses from data sheet) -- avr/include/avr/
//
// att45_schaad1.c
//
// Created by Raphael Schaad on 2015-11-16.
// This is free and unencumbered software released into the public domain.
//
// Import headers installed with CrossPack-AVR (/usr/local/CrossPack-AVR/)
#include "stdbool.h" // So we have 'true' and 'false' instead of 1 and 0 (might have memory implications) -- lib/gcc/avr/4.8.1/include/
#include <avr/io.h> // Umbrella header including e.g. iotn45.h for our chip, defining PORTB/DDRB/PBn -- avr/include/avr/
@raphaelschaad
raphaelschaad / cocoon_embedded.ino
Last active December 16, 2015 15:17
Arduino code for the COCOON, my final project for MIT Media Lab How to Make (almost) Anything http://fab.cba.mit.edu/classes/863.15/section.CBA/people/Schaad/index.html
//
// cocoon_embedded.ino
//
// Created by Raphael Schaad on 2015-12-12.
// This is free and unencumbered software released into the public domain.
//
// Right motor breakout board (looking at it from the front)
const int R_BTN1 = 3; // left (cocoon down); PD3; Arduino Uno use pin 3; hello.arduino use pin 7
const int R_BTN2 = 4; // right (cocoon up); PD4; Arduino Uno use pin 4; hello.arduino use pin 8
@raphaelschaad
raphaelschaad / processing_basics.pde
Last active February 1, 2016 01:05
Processing Sketch with a basic structure for learning purposes.
//
// processing_basics.pde
//
// Processing sketch with a basic structure for learning purposes.
//
// Created by Raphael Schaad on 2016-01-23.
// This is free and unencumbered software released into the public domain.
//
// Define global vars/consts (all typed), and import libs
@raphaelschaad
raphaelschaad / processing_meteormap.pde
Last active January 25, 2016 05:39
Processing sketch visualizing a large set of meteorite strikes as a map for learning purposes. To run, extract data.zip because GitHub Gist doesn't allow folders but Processing expects external resources in ./data. https://www.skillshare.com/classes/design/Data-Visualization-Designing-Maps-with-Processing-and-Illustrator/1063775924
//
// processing_meteormap.pde
//
// Processing sketch visualizing a large set of meteorite strikes as a map for learning purposes.
// To run, extract xdata.zip because GitHub Gist doesn't allow folders but Processing expects external resources in ./data.
// https://www.skillshare.com/classes/design/Data-Visualization-Designing-Maps-with-Processing-and-Illustrator/1063775924
//
// Created by Raphael Schaad on 2016-01-23.
// This is free and unencumbered software released into the public domain.
//
@raphaelschaad
raphaelschaad / imsg-cleaner.py
Last active January 27, 2016 23:53
Renames CSV files of iMessages extracted with iExplorer from iTunes backup and prints start and end date of conversations.
#!/usr/bin/env python
#coding=utf-8
#
# imsg-cleaner.py
#
# Renames CSV files of iMessages extracted with iExplorer from iTunes backup and prints start and end date of conversations.
#
# Created by Raphael Schaad on 2013-12.
# This is free and unencumbered software released into the public domain.
#