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 | |
/** | |
* Currying in PHP 5.2.x for simple variables | |
* @author Zack Douglas <[email protected]> | |
*/ | |
/** | |
* e.g. | |
* $arr = Array(1, 2, 3); | |
* $le2 = curry_left('ge', 2); |
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
/* | |
* To be used with | |
* <https://github.com/wellspringworldwide/PHP-ClassMixer> | |
*/ | |
abstract class Tapable_Mixin { | |
public function tap($var_of_this, $eval) { | |
$$var_of_this = $this; | |
eval($eval); | |
} | |
} |
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 | |
/** | |
* checks syntax and optionally DNS records for the provided email address string | |
*/ | |
function validateEmail($email, $and_dns=true) { | |
if (!filter_var($em, FILTER_VALIDATE_EMAIL)) { | |
return false; | |
} | |
if (!$and_dns) { | |
return true; |
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
select ?person ?authship ?publication | |
where | |
{ | |
?person rdf:type foaf:Person . | |
?person core:authorInAuthorship ?authship . | |
?authship core:linkedInformationResource ?publication | |
} | |
limit 10 |
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 | |
/******************************************************************************* | |
* Expandable Class | |
* | |
* Authors:: [email protected] | |
* | |
* Copyright:: Copyright 2009, Wellspring Worldwide, LLC Inc. All Rights Reserved. | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at |
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
#!/usr/bin/bash | |
FOO='the scarecow walks at midnight' | |
if [ 'the scarecrow walks at midnight' = ${FOO/scarecow/scarecrow/} ] ; then | |
echo 'your shell supports regex on variable retrieval' | |
fi |
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
Test = SC.Application.create({ NAMESPACE: 'Test', VERSION: '0.1.0', store: SC.Store.create().from(SC.Record.fixtures) }) ; | |
Test.Top = SC.Record.extend({ | |
middles: SC.Record.toMany( | |
SC.Record.extend({ | |
bottoms: SC.Record.toMany( | |
SC.Record, | |
{ | |
isNested: YES, | |
isMaster: NO |
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
var r = [ ( function (l, r) { return l + r; } ), | |
( function (a, b) { return '' + a + b; } )] | |
[ [ 0, 1 ].indexOf( 0 + /PHPSESSID/.test(document.cookie) ) ](1,2); |
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
var | |
myObject = { | |
myfield: 'Not empty' | |
}, | |
validations = { | |
myfield: Namespace.Validators.getNotEmpty('myfield', 'My Field')(myObject) | |
}; |
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
;new RegExp('a-z:_\\s\\\\-\\\\.0-9\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u010000-\\u0EFFF\u00B7\\u0300-\\u036F\\u203F-\\u2040'); |
OlderNewer