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 | |
error_reporting(E_ALL | E_STRICT); | |
ini_set('display_errors',1); | |
$publicDir = '/home/groups/s/sa/sabredav/persistent/public'; | |
$pdo = new PDO('sqlite:/home/groups/s/sa/sabredav/persistent/db/db.sqlite'); | |
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
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 | |
$router = new \My\Router(); | |
$router->add('GET /blog/(?P<postId>[\d]+)', function($postId) { | |
return new \My\Blog\Controller($postId); | |
}); |
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 | |
error_reporting(E_ALL | E_STRICT); | |
ini_set('display_errors',1); | |
$publicDir = '/path/to/public/directory'; | |
$pdo = new PDO('sqlite:/path/to/sqlite/database'); | |
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
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
// ==UserScript== | |
// @name Referral: your mom | |
// @namespace yourmom | |
// @description This script changes every utm_source variable in links to 'Your mom'. | |
// @include * | |
// ==/UserScript== | |
var links = document.getElementsByTagName('a'); | |
for(var i=0; i<links.length; i++) { | |
links[i].href = links[i].href.replace(/([&|?])utm_source=(.*)([&|?|^])/,"$1utm_source=Your+mom$3"); |
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 | |
function alarmExpand(Sabre_VObject_Component_VCalendar $calendar, DateTime $start, DateTime $end) { | |
// You should adjust these to be more reasonable | |
$startScan = new DateTime('1995-01-01'); | |
$endScan = new DateTime('2030-01-01'); | |
$newEvents = array(); |
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
$tree = array( | |
new Sabre_DAV_SimpleCollection('principals' , array( | |
new Sabre_CalDAV_Principal_Collection($backend, 'principals/projects'), | |
new Sabre_CalDAV_Principal_Collection($backend, 'principals/users'), | |
)); | |
); |
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 | |
if ($argc < 2) { | |
echo "Usage: \n"; | |
echo "\n"; | |
echo "1. Wait till you get an invite for a silly wordgame\n"; | |
echo "2. execute $argv[0] [letters]\n"; | |
echo "3. Win\n"; | |
die(); |
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> | |
<head> | |
<title>This is it</title> | |
<meta charset="utf-8" /> | |
<style type="text/css"> | |
hr { | |
border: 0px; | |
} |
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 | |
$a = 1; | |
$b = 2; | |
$c = 3; | |
list($a, $b, $c) = false; | |
var_dump([ | |
$a, $b, $c |
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
--- original.xml 2013-07-23 00:42:13.000000000 +0200 | |
+++ next.xml 2013-07-23 00:37:10.000000000 +0200 | |
@@ -580,6 +580,26 @@ | |
</entry> | |
</row> | |
<row> | |
+ <entry valign="top"><constant>CURLOPT_POSTREDIR</constant></entry> | |
+ <entry valign="top"> | |
+ <para> | |
+ Set the behavior for following redirects with |
OlderNewer