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
/** | |
* Simple animation to illustrate Processing.org HD video export using FFmpeg | |
* See this post for complete details | |
* http://owenmundy.com/blog/2013/01/use-processing-and-ffmpeg-to-export-hd-video/ | |
* 2013 Owen Mundy owenmundy.com | |
*/ | |
float xtheta = 0.0; | |
float ytheta = 0.0; |
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
<?php | |
/* Advanced scraping demo with "regex" parsing. Retrieves current | |
* weather in any city and colors the background accordingly. | |
* The math below for normalization could use some work. | |
* Owen Mundy Copyright 2011 GNU/GPL */ | |
?> | |
<html> |
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
<?php | |
/* Basic scraping demo with "regex" parsing | |
* Owen Mundy Copyright 2011 GNU/GPL */ | |
$url = "http://www.bbc.co.uk/news/"; // 0. url to start with | |
$contents = file_get_contents($url); // 1. get contents of url in a string | |
// 2. match title |
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
<?php | |
/* Basic scraping demo with "find-replace" parsing | |
* Owen Mundy Copyright 2011 GNU/GPL */ | |
$url = "http://www.bbc.co.uk/news/"; // 0. url to start with | |
$contents = file_get_contents($url); // 1. get contents of page in a string | |
// 2. search and replace contents |
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
<?php | |
/* Basic scraping demo with "foreach" parsing | |
* Owen Mundy Copyright 2011 GNU/GPL */ | |
$url = "http://www.bbc.co.uk/news/"; // 0. url to start with | |
$lines = file($url); // 1. get contents of url in an array | |
foreach ($lines as $line_num => $line) // 2. loop through each line in page |
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
<?php | |
/* Basic scraping demo with "foreach" and "regex" parsing | |
* Owen Mundy Copyright 2011 GNU/GPL */ | |
// url to start | |
$url = "http://www.bbc.co.uk/news/"; | |
// get contents of url in an array | |
$lines = file($url); |
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
// Hello World file for Processing or Processing.js | |
void setup(){ | |
size(1000,700); | |
background(255); | |
} | |
void draw(){ | |
stroke(random(255),random(255), random(255)); | |
line(random(width),random(height), random(width),random(height)); | |
println("Hello World!"); | |
} |
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
# analog-test-all-pins.py - Owen Mundy | |
# Print reading from each analog-in pin on a BeagleBone | |
# with a short delay between each | |
# This example is in the public domain | |
import os,time | |
i = 1 | |
while(True): | |
os.system("cat /sys/bus/platform/devices/tsc/ain" + str(i)) |
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
# analog-test-all-pins.py - Owen Mundy | |
# Print reading from each analog-in pin on a BeagleBone | |
# with a short delay between each | |
# using mrBBIO by Matt Richardson: | |
# https://github.com/mrichardson23/mrBBIO | |
# This example is in the public domain | |
from mrbbio import * | |
def setup(): |
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
javascript: (function () { | |
function creator(e, t, n) { | |
var r = document.createElement(n); | |
var att = document.createAttribute("style"); | |
att.value = "max-width:120px"; | |
r.setAttributeNode(att); | |
var i = document.createTextNode(t); | |
r.appendChild(i); | |
e.appendChild(r); | |
} |
OlderNewer