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
map $http_accept $api_version { | |
default 0; | |
"application/vnd.example.v1+json" 1; | |
} | |
server { | |
listen 80; | |
listen [::]:80; |
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
function phpToMoment(str) { | |
let replacements = { | |
'd' : 'DD', | |
'D' : 'ddd', | |
'j' : 'D', | |
'l' : 'dddd', | |
'N' : 'E', | |
'S' : 'o', | |
'w' : 'e', |
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 boot(DispatcherContract $events) | |
{ | |
parent::boot($events); | |
$path = storage_path().'/logs/query.log'; | |
\Event::listen('illuminate.query', function($sql, $bindings, $time) use($path) { | |
// Uncomment this if you want to include bindings to queries | |
//$sql = str_replace(array('%', '?'), array('%%', '%s'), $sql); | |
//$sql = vsprintf($sql, $bindings); | |
$time_now = date('Y-m-d H:i:s'); |
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 | |
/** | |
* Collaborated with http://github.com/pittgikera | |
*/ | |
$text = $_GET['text']; | |
//$questions = "How was is it? # Was it enjoyable?# Did you have fun? # Will you come back?"; | |
$questions = ""; |
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 | |
// include Faker in your project (https://github.com/fzaninotto/Faker#installation) | |
use Faker\Factory as Faker; | |
$faker = Faker::create(); | |
$regex = "/(\+?254|0){1}[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}/"; | |
$samplePhoneNumber = $faker->regexify($regex); |
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
# KE | |
SAFARICOM: "/(\+?254|0|^){1}[-. ]?[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}\z/" | |
AIRTEL: "/(\+254|0|^){1}[-. ]?[7]{1}([3]{1}[0-9]{1}|[8]{1}[5-9])[0-9]{6}\z/" | |
# TZ | |
TIGO: "/(\+?255|0|^){1}[-. ]?([7]{1}[1]{1}[2-9]{1}|[6]{1}[57]{1}[2-9]{1})[0-9]{6}\z/" |
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
/* | |
Taken from: https://gist.github.com/soufianeEL/3f8483f0f3dc9e3ec5d9 | |
Modified by Ferri Sutanto | |
- use promise for verifyConfirm | |
Examples : | |
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}"> | |
- Or, request confirmation in the process - | |
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?"> |
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 | |
abstract class AbstractEntity extends AbstractValueObject | |
{ | |
/** | |
* Offset Set | |
* | |
* @param mixed $offset | |
* @param mixed $value | |
* |
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 | |
/** | |
* Description of VideoStream | |
* | |
* @author Rana | |
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial | |
*/ | |
class VideoStream | |
{ | |
private $path = ""; |
NewerOlder