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 | |
$string_create = 'create_some_long_tablename'; | |
$string_add = 'add_some_tablename_to_other_long_table_name'; | |
function get($string) { | |
$string = str_replace(array('create_', 'add_','_to_'), array('create-', 'add-', '-to-'), $string); | |
if (preg_match('/^(create|add)\-([A-Za-z0-9\_]*)(\-to\-)?([A-Za-z0-9\_]*)?$/i', $string, $matches)) { | |
if ($matches[1] == 'create') { |
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 ic = '090303086521'; | |
if(ic.match(/^(\d{2})(\d{2})(\d{2})-?\d{2}-?\d{4}$/)) { | |
var year = RegExp.$1; | |
var month = RegExp.$2; | |
var day = RegExp.$3; | |
console.log(year, month, day); | |
var now = new Date().getFullYear().toString(); |
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
*~ | |
*.bak | |
Thumbs.db | |
desktop.ini | |
.DS_Store | |
.buildpath | |
.project | |
.settings | |
fuel/app/config/db.php | |
fuel/app/logs/*/*/* |
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
#!/bin/bash | |
# | |
cd ~/htdocs/fuelphp | |
git checkout $1 | |
echo 'start updating repository to master branch' | |
echo 'update fuel' | |
cd ~/htdocs/fuel/fuel | |
git checkout $1 |
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> | |
<html> | |
<head> | |
<title></title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<select id="the-list" multiple="multiple"> | |
<option id="list-1" value="1">Hello World</option> |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| OneAuth IoC | |
|-------------------------------------------------------------------------- | |
| | |
| Register Auth adapter as IoC, allow it to be replaced by any Authentication | |
| bundle that doesn't use Laravel\Auth\Drivers | |
*/ |
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 | |
// In order to overwrite the default listener we must add the event overwrite | |
// after the bundle is started. | |
Event::listen('laravel.started: oneauth', function () | |
{ | |
Event::clear('oneauth.logged'); | |
Event::listen('oneauth.logged', function ($client, $userdata) | |
{ |
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 | |
Event::listen('oneauth.logged', function ($client, $user_data) | |
{ | |
if ($client->user_id > 0) | |
{ | |
// get user information using eloquent. | |
$user = User::find($client->user_id); | |
$user->avatar = $user_data['info']['image']; |
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
[mysqld] | |
default-storage-engine=InnoDB | |
collation-server=utf8_unicode_ci | |
character-set-server=utf8 | |
init-connect='SET NAMES utf8' | |
table_cache=250 | |
query_cache_size=0 | |
query_cache_type=0 |
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 | |
$email = "Mior Muhammad Zaki <[email protected]>"; | |
if (preg_match('/^(.+\s)<(.*)>$/', $email, $matches)) | |
{ | |
$name = $matches[1]; | |
$email = $matches[2]; | |
} |
OlderNewer