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
/** | |
* Stroked, shadowed text! | |
* http://stackoverflow.com/q/12398429/707111 | |
*/ | |
@import url("http://fonts.googleapis.com/css?family=Londrina+Solid"); | |
body { | |
background-color: #d47400; | |
} |
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
/** | |
* Alternating background colours | |
*/ | |
.postcontainer { | |
background-color: lightblue; | |
padding: 0.2em; | |
} | |
.postcontainer:nth-of-type(2n) { |
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
/** | |
* Alternating background colours | |
*/ | |
.postcontainer { | |
background-color: lightblue; | |
padding: 0.2em; | |
} | |
.postcontainer:nth-of-type(2n) { |
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
/** | |
* Automatically scaling a background image | |
*/ | |
background-image: url('http://www.gstatic.com/ui/v1/icons/mail/logo_default.png'); | |
background-position: center; | |
background-repeat: no-repeat; | |
background-size: auto 100%; | |
min-height: 100%; |
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
/** | |
* Overriding a class with tags | |
* | |
* IDs have a value of 100, classes have a value of 10, tags have a value of 1. In an arbitrarily large base. | |
* Which apparently (at least on my browser) is 256. | |
* (Why do I know this?) | |
*/ | |
div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div |
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
function js_string($value) { | |
return '"' . str_replace(array("\r\n", "\r", "\n"), array("\n", "\n", '\n'), addslashes($value)) . '"'; | |
} |
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
/** | |
* Pretending that a webfont is bold. | |
* http://stackoverflow.com/a/12168041/707111 | |
*/ | |
@font-face { | |
font-family: 'Headland One'; | |
font-style: normal; | |
font-weight: 400; | |
src: local('Headland One'), local('HeadlandOne-Regular'), url(http://themes.googleusercontent.com/static/fonts/headlandone/v1/iGmBeOvQGfq9DSbjJ8jDV3hCUOGz7vYGh680lGh-uXM.woff) format('woff'); |
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
// Translates web pages to cat | |
!function(d,p,i,j,c,n){for(p=d.querySelectorAll('p'),i=p.length;j--&&(n=c[j])||i--&&(c=p[i].childNodes,n=c[j=c.length-1]);)if(n.nodeType==3)p[i].replaceChild(d.createTextNode(n.nodeValue.replace(/([a-z])[a-z]*/gi,function(p,i){return/[a-z]/.test(i)?'meow':'Meow'})),n);}(document); |
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
// Some code I found from 2009 :) | |
function isNullOrUndefined(o) { | |
if(o === null) { | |
return true; | |
} | |
if(typeof o === "undefined") { | |
return true; | |
} | |
if(o === undefined) { |
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
// A failed attempt | |
function animate() { | |
g.clearRect(0, 0, 32, 32); | |
var t = (new Date().getTime() - start) / 1000; | |
var circlePosition = Math.min(1, Math.abs(Math.tan(t * Math.PI) / Math.PI)); | |
g.beginPath(); | |
g.arc(16 + Math.cos(circlePosition * Math.PI) * 8, 16 + Math.sin(circlePosition * Math.PI) * 8, 2.5, 0, Math.PI * 2); |