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
switch ($_GET['filter']) { | |
case 0: | |
// do stuff; | |
break; | |
case "none": | |
// do otherStuff; | |
break; | |
} | |
// case 0: triggers even when $_GET['filter'] evaluates to "none" |
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
if (isset($item->url)) { | |
$post_content .= "\n\n<a href='".$item->url."'>Comment on Google+</a>"; | |
} |
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
/* | |
A tiny utility for creating a json array of dates. | |
I need this for creating year-long timetables where after an initial start | |
we have a few weeks off for christmas, then easter, and these weeks differ | |
each year, so the 'switches' make it easy to include weeks (signified by a 1) | |
or exclude weeks (a 0) | |
Note that monts start at 0 not 1 :-) |
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
(function shrinky() { | |
var q = document.querySelectorAll(".shrink"); | |
window.addEventListener( | |
"scroll", | |
function scroll () { | |
var i, z = 100-(Math.min(window.pageYOffset,100)/2); | |
for(i=0; i<q.length; i++) { | |
q[i].style.fontSize = z+"%"; |
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
{ | |
"U21277-12YR": { | |
"ucode" : "U22344", | |
"name" : "Web Research", | |
"scode" : "WebRes" | |
}, | |
"U22344-12YR": { | |
"ucode" : "U22344", | |
"name" : "Business Systems Analysis & Design", | |
"scode" : "BUSAD" |
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
// This scene of the utah teapot requires no additional files. It creates a | |
// picture of an elongated teapot (so that the original physical teapots | |
// dimensions are honoured, and places this crockery in a plain white | |
// environment. | |
// | |
// Utah Teapot using Bezier patches was adapted by Alexander Enzmann from | |
// the original model by Martin Newell. | |
// Scene created by Rich Boakes - http://boakes.org/teapot | |
#declare Flat_Enough = 0.00001; |
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
function createObject() { | |
var request_type; | |
var browser = navigator.appName; | |
if(browser == "Microsoft Internet Explorer"){ | |
request_type = new ActiveXObject("Microsoft.XMLHTTP"); | |
} | |
else{ | |
request_type = new XMLHttpRequest(); | |
} | |
return request_type; |
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
<!doctype html> | |
<title>Dumb CSS Speed Test</title> | |
<style id="x"> | |
</style> | |
<nav> | |
<ul> | |
<li>1 | |
<ul> | |
<li class="q">1</li> | |
<li class="q">2</li> |
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
//varscope | |
var x1 = 3; | |
for (var y1=x1;y1>0; y1--) { | |
var x1 = y1; | |
console.log(x1); | |
console.log(y1); | |
} | |
console.log(x1); | |
console.log(y1); |
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
(function() { | |
var i, y, result = [], x = document.querySelectorAll("input[type=checkbox]"); | |
for (i in x) { | |
y = x[i].defaultValue; | |
if (y) { | |
var r = {} | |
r.orig = y; | |
r.email = y.split(",")[0].trim(); | |
r.name = y.split(",")[1].trim(); | |
r.jupiter = r.email.substr(2).replace('@myport.ac.uk', ''); |
OlderNewer