This was born out of weekend of playing with p5.js that eventually ended up being my Twitter profile banner updated every hour via a cron job on the server, using Phantomjs to snap the resultant image.
This file contains hidden or 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
| if (!Function.prototype.bind) { | |
| Function.prototype.bind = function (oThis) { | |
| if (typeof this !== "function") { | |
| // closest thing possible to the ECMAScript 5 | |
| // internal IsCallable function | |
| throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); | |
| } | |
| var aArgs = Array.prototype.slice.call(arguments, 1), | |
| fToBind = this, |
This file contains hidden or 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
| /* | |
| ISO 216 paper sizes converted to pixels @ 300dpi | |
| Drop this file in your Processing sketch and use like so: size(A1w, A1h); | |
| */ | |
| final int A5w = 1748; | |
| final int A5h = 2480; | |
| final int A4w = 2480; |
This file contains hidden or 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
| /* | |
| Simple video scrubbing example using Leap Motion | |
| Made for Processing – requires LeapMotionP5 library | |
| An open hand pauses the video and then allows you to scrub the video left and right. | |
| Closing your hand plays the video. | |
| http://brendandawes.com/blog/leapmotion | |
| */ |
This file contains hidden or 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 processing.pdf.*; | |
| /* | |
| James Bond Kills by Brendan Dawes | |
| http://brendandawes.com/projects/jamesbondkills/ | |
| CSV import method by che-wei wang. | |
| Requires CSV export from data provided by Guardian Data Store. | |
| https://docs.google.com/spreadsheet/ccc?key=0AonYZs4MzlZbdEgyUE9aQktJR0ZEWFlURGlYODNISHc#gid=1 |
This file contains hidden or 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
| // Ben Folds Five Poster - Cityscape Generator by Brendan Dawes | |
| // http://brendandawes.com/projects/benfoldsfive/ | |
| // Requires library from http://toxiclibs.org | |
| import toxi.color.*; | |
| import toxi.util.datatypes.*; | |
| import processing.pdf.*; | |
| final color BACKGROUND_COLOR = color(240); |
This file contains hidden or 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
| /* | |
| Toy Rocket Construction Kit by Brendan Dawes | |
| brendandawes.com | |
| Nose cone isn't great but it suffices for now! | |
| */ | |
| rocketRadius = 20; | |
| connectorHeight = 5; |
This file contains hidden or 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
| <?php | |
| function download($url){ | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL,$url); | |
| curl_setopt($ch, CURLOPT_FAILONERROR,1); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); | |
| curl_setopt($ch, CURLOPT_TIMEOUT, 15); | |
| $retValue = curl_exec($ch); |
This file contains hidden or 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
| // Happiness Machine Arduino / Nanode Code | |
| // See www.brendandawes.com | |
| #include <EtherCard.h> | |
| #include <NewSoftSerial.h> | |
| NewSoftSerial Thermal(2, 3); //Soft RX from printer on D2, soft TX out to printer on D3 | |
| #define FALSE 0 | |
| #define TRUE 1 |