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
--- scrabble 2005-10-18 16:14:08.599699208 -0400 | |
+++ scrabble-aipatch 2005-10-18 16:29:27.212048904 -0400 | |
@@ -3,11 +3,15 @@ | |
# | |
# Scrabble -- a crossword game | |
# | |
-# Version: 1.9 | |
+# Version: 1.9 (AI patch) | |
# | |
# Written by Brian White <[email protected]> |
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 memory_show_usage() | |
{ | |
$base = null; | |
if(is_null($base)) | |
{ | |
$base = 1; | |
$base = memory_get_usage; | |
} | |
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
<?php | |
/* | |
* A demonstration of first-class functions in PHP. | |
* Blog post: http://www.sbisbee.com/blog.php?id=2352301864 | |
* | |
* By Sam Bisbee <www.sbisbee.com> on 2010-12-17 | |
*/ | |
function makeLouder($fn) | |
{ |
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
Proposal to Prevent CSRF Attacks on CouchDB with Tokens | |
======================================================= | |
This is a draft for commentary from the community. | |
Goals | |
----- | |
1. Establish a mechanism that would defeat CSRF attacks against CouchDB by | |
leveraging the standard provided by OWASP at |
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
From d7b26202e965fec47cb42fdc5a6113820de2c47b Mon Sep 17 00:00:00 2001 | |
From: Sam Bisbee <[email protected]> | |
Date: Fri, 11 Feb 2011 13:47:05 -0500 | |
Subject: [PATCH] Moving the config check to Sag's constructor, and updating tests. | |
--- | |
src/Sag.php | 6 +++--- | |
tests/SagConfigurationCheckTest.php | 18 +++++++++--------- | |
2 files changed, 12 insertions(+), 12 deletions(-) |
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
#!/usr/bin/php | |
<?php | |
/* | |
* php2json | |
* by Sam Bisbee <[email protected]> | |
* on 2011-02-23 | |
* | |
* Takes in a class file, instantiates it, and then spits out its JSON. | |
* | |
* Example Usage: ./php2json.php UserVO.php |
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
<?php | |
/* | |
* A real quick example to get and update a doc. | |
*/ | |
require_once('./src/Sag.php'); | |
$sag = new Sag('127.0.0.1', '5984'); | |
// Select the database that holds our blog's data. | |
$sag->setDatabase('blog'); |
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
<?php | |
abstract class ValueObject | |
{ | |
public function __construct($src = null) | |
{ | |
if($src) | |
self::populate($src); | |
} | |
/** |
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
<?php | |
require_once 'CouchSessionStore.php'; | |
class SuperCouchSessionStore extends CouchSessionStore | |
{ | |
public static function setSag($sag) | |
{ | |
//use CouchSessionStore to set everything up, so our $this->sag == $sag | |
parent::setSag($sag); |
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
#!/usr/bin/php | |
<?php | |
require('Sag.php'); | |
$sag = new Sag(); | |
$sag->setDatabase('bwah'); | |
for($i = 0; $i < 1000; $i++) { | |
echo "$i\n"; | |
if(!$sag->post(array('hi' => 'there'))->body->ok) { | |
echo "\t!!!!!!FAIL!!!!!!\n"; |
OlderNewer