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
### Keybase proof | |
I hereby claim: | |
* I am christiaan on github. | |
* I am christiaan (https://keybase.io/christiaan) on keybase. | |
* I have a public key whose fingerprint is EF6C C61C 8A45 47FB A836 468D AB7D 8826 53C3 BB7E | |
To claim this, I am signing this object: |
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 | |
t('<a class="close close-btn" href="#">×</a> | |
<p>There has been placed <strong>%d new</strong> content items since your last visit.</p> | |
<div class="alert-actions"> | |
<a id="new_content_view" class="btn small" href="%s">View items</a> <a id="new_content_opt_out" class="btn small" href="#">Don\'t notify me again</a> | |
</div>', | |
$count, | |
$text->entities(rtrim($nav->getCollectionURL($page), '/')) . '/' . $model->timestamp() | |
) |
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
Index: hyphenation.php | |
=================================================================== | |
@@ -23,13 +23,9 @@ | |
// Convert patterns | |
function convert_patterns($patterns) { | |
- $patterns = mb_split(' ', $patterns); | |
- $new_patterns = array(); | |
- for($i = 0; $i < count($patterns); $i++) { | |
- $value = $patterns[$i]; |
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
<!doctype html> | |
<html> | |
</head> | |
<style> | |
textarea { | |
width : 100%; | |
/* only allow resize vertically */ | |
min-width : 100%; | |
max-width : 100%; | |
height: 100px; |
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 | |
class Object implements IteratorAggregate, ArrayAccess | |
{ | |
private $getters = array(); | |
private $setters = array(); | |
private $values = array(); | |
private $prototype = null; | |
private $prototype_values = array(); | |
public function __get($name) |
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 bind(obj, func) { | |
if(func.constructor === String) { | |
func = obj[func]; | |
} | |
if(!(func instanceof Function)) { | |
throw new TypeError("func should be a Function"); | |
} | |
return function() { | |
return func.apply(obj, arguments); | |
}; |
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
// @author Christiaan Baartse <[email protected]> | |
function newObject(objectClass, args) { | |
for(var argParams = [], i = 0, len = args.length; i < len; i++) { | |
argParams.push("a["+i+"]"); | |
} | |
return (new Function("c", "a", | |
"return new c("+argParams.join(",")+");"))(objectClass, args); | |
}; | |
// 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 class that takes the pain out of the $_FILES array | |
* @author Christiaan Baartse <[email protected]> | |
* @copyright 2010 Christiaan Baartse | |
*/ | |
class UploadedFiles extends ArrayObject | |
{ | |
public function current() { | |
return $this->_normalize(parent::current()); |
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
/* | |
* JS Port of Pimple by Fabien Potencier http://github.com/fabpot/Pimple | |
*/ | |
function Pimple() {} | |
Pimple.prototype = { | |
set : function(id, value, shared) { | |
if(value.constructor === Function) { | |
if(shared) { | |
value = this.asShared(value); |