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 | |
//^.*(?=:) selects name | |
$subject = 'name:varchar(255)'; | |
preg_match('/(?P<type>\w+)($|\((?P<length>(\d+|(.*)))\))/', $subject, $matches); | |
print_r($matches); |
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
preg_match('/^(?P<name>[a-z]+):(?P<type>\w+)($|\((?P<length>(\d+|(.*)))\))/', $subject, $matches); |
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 | |
/* | |
Plugin Name: Location | |
Description: Manage locations of restaurants, and the displaying of them. | |
Version: 1.0 | |
Author: Riser Media | |
Author URI: http://www.risermedia.com | |
License: Commercial | |
*/ |
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
/** | |
* Ruby | |
*/ | |
class Person | |
def initialize(name) | |
@name = name.capitalize | |
@loves = []; | |
end | |
def love(what) |
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
public function as_csv($columns) | |
{ | |
foreach($this->as_array() as $item) | |
{ | |
$csv .= implode(',', Arr::extract($item, $columns))."\n"; | |
} | |
} |
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 | |
/** | |
* CSV Class | |
*/ | |
class CSV | |
{ | |
public static function factory($path = NULL) | |
{ |
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 | |
public function __call($name, $arguments) | |
{ | |
if($name === 'find_file') | |
{ | |
return call_user_func_array($name, $arguments); | |
} | |
} |
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 | |
$user = ORM::factory('user'); | |
$user->email = Arr::get($_POST, 'email'); | |
$user->username = Arr::get($_POST, 'email'); | |
$user->password = '123456'; | |
$user->save(); |
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
document.cookie.match('(?:^|;)\\s*' + myCookieKey.escapeRegExp() + '=([^;]*)'); |
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 | |
$json = new stdClass(); | |
$json->states = function(){ | |
$array = array(); | |
foreach($db->get_states() as $state) | |
{ | |
$array[] = $state; | |
} |