Skip to content

Instantly share code, notes, and snippets.

View will-in-wi's full-sized avatar

William Johnston will-in-wi

View GitHub Profile
@will-in-wi
will-in-wi / gist:3668580
Created September 7, 2012 18:54
Test for iTunes Album Art Sizes
<?php
$starting_links = array('http://a5.mzstatic.com/us/r1000/107/Music/v4/3a/1c/4b/3a1c4bff-7b99-2162-3036-54157c6924e6/0818610010094_1200x1200_300dpi.100x100-75.jpg',);
$timeout = 1; // In seconds
foreach ($starting_links as $link) {
$curr_size = 25;
while ($curr_size < 2000) {
$result = get_headers(str_replace('100x100', $curr_size . 'x' . $curr_size, $link));
if ($result[0] === 'HTTP/1.0 404 Not Found') {
@will-in-wi
will-in-wi / gist:3841181
Created October 5, 2012 17:31
ffmpeg error for homebrew
CC libavdevice/alldevices.o
CC libavdevice/avdevice.o
CC libavdevice/lavfi.o
CC libavfilter/af_aconvert.o
CC libavfilter/af_aformat.o
CC libavfilter/af_amerge.o
CC libavfilter/af_amix.o
CC libavfilter/af_anull.o
brew: superenv removed: -I./ -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3
brew: superenv removed: -I./ -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3
@will-in-wi
will-in-wi / gist:4120767
Created November 20, 2012 20:19
Kindle Fire HTML5 Audio Streaming Bug Test Case
<!doctype html>
<html>
<head>
<title>Audio Streaming test</title>
</head>
<body>
<div>
<p>
Test page for Kindle Fire Audio Streaming. Using 89.3 The Current as an example.
</p>
@will-in-wi
will-in-wi / gist:4251908
Created December 10, 2012 17:13
Soundmanager Test Results
<table>
<tr>
<td> </td>
<td> Pure JS - Different vars </td>
<td> Pure JS - Same var </td>
<td> SM2 - Same var </td>
<td> SM2 - Different vars </td>
<td> SM2 - Same ID </td>
</tr>
<tr>
@will-in-wi
will-in-wi / gist:4251919
Created December 10, 2012 17:14
Soundmanager Test
<!doctype html>
<html>
<head>
<title>This is an audio tag test.</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<style>
.button {
display: block;
padding: 10px;
border: 1px solid gray;
@will-in-wi
will-in-wi / gist:4355041
Created December 21, 2012 19:09
Example for streaming audio issue.
<!doctype html>
<html>
<head>
<title>This is an audio tag test.</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="soundmanager/script/soundmanager2.js"></script>
<script>
$(function(){
soundManager.setup({
@will-in-wi
will-in-wi / circle.js
Created January 12, 2013 16:59
ScriptCraft Circle Plugin
// Circle
function rasterCircle(radius, height, material) {
var f = 1 - radius;
var ddF_x = 1;
var ddF_y = -2 * radius;
var x = 0;
var y = radius;
fwd(radius).box(material,1,height,1);
fwd(0-radius).box(material,1,height,1);
@will-in-wi
will-in-wi / sphere.js
Created January 13, 2013 19:52
Basic code to create a filled sphere with ScriptCraft
function sphere(material, radius) {
for (var i = 0; i <= radius; i++) {
up(radius + i).fwd(radius - Math.round(Math.sqrt(radius*radius - i*i))).right(radius - Math.round(Math.sqrt(radius*radius - i*i))).cylinder(material, Math.round(Math.sqrt(radius*radius - i*i)), 1);
up(radius - i).fwd(radius - Math.round(Math.sqrt(radius*radius - i*i))).right(radius - Math.round(Math.sqrt(radius*radius - i*i))).cylinder(material, Math.round(Math.sqrt(radius*radius - i*i)), 1);
}
}
@will-in-wi
will-in-wi / displayChars.php
Last active December 12, 2015 12:19
Useful for debugging weird character encoding issues.
<?php
function displayChars($str) {
$arr = array();
$chars = str_split($str);
foreach ($chars as $key => $value) {
$arr[] = array($value, ord($value));
}
var_dump($arr);
}
@will-in-wi
will-in-wi / gist:5031902
Created February 25, 2013 18:07
SSI Copyright Example
<footer>
<p>&copy; <!--#config timefmt="%Y" --> <!--#echo var="DATE_LOCAL" --> My Company, Inc.</p>
</footer>