Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
[
{
"athlete": "Michael Phelps",
"age": 23,
"country": "United States",
"year": 2008,
"date": "24/08/2008",
"sport": "Swimming",
"gold": 8,
"silver": 0,
@mturac
mturac / p3pforsafari
Created October 30, 2012 15:32
p3p problem
<?php
if (isset($_GET['setdefaultcookie'])) {
// top level page, set default cookie then redirect back to canvas page
setcookie ('default',"1",0,"/");
$url = substr($_SERVER['REQUEST_URI'],strrpos($_SERVER['REQUEST_URI'],"/")+1);
$url = str_replace("setdefaultcookie","defaultcookieset",$url);
$url = "http://www.facebook.com/PAGEURL";
echo "<html>\n<body>\n<script>\ntop.location.href='".$url."';\n</script></body></html>";
exit();
} else if ((!isset($_COOKIE['default'])) && (!isset($_GET['defaultcookieset']))) {
@mturac
mturac / console.log
Created October 10, 2012 07:59
console control
propaganda.common.writeLog = function(str)
{
if(typeof console != 'undefined')
console.log(str);
}
@mturac
mturac / iContains.js
Created October 10, 2012 07:49
jQuery case insensitive contains
jQuery.expr[':'].iContains = function(a, i, m) {
return jQuery(a).text().toUpperCase()
.indexOf(m[3].toUpperCase()) >= 0;
};