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 | |
$dir = __DIR__.'/photos'; | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1', 6379); | |
function get($url) { | |
//curl get | |
echo $url."\n"; | |
$curlOptions = array( | |
CURLOPT_ENCODING => 'gzip,deflate', |
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
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 namespace App\Services\Jwt\Exceptions; | |
class BeforeValidException extends \UnexpectedValueException { } |
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
<?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
/* | |
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
# 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
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
<?php | |
define('FRESHDESK_SHARED_SECRET','____Place your Single Sign On Shared Secret here_____'); | |
define('FRESHDESK_BASE_URL','http://{{your-account}}.freshdesk.com/'); //With Trailing slashes | |
function getSSOUrl($strName, $strEmail) { | |
$timestamp = time(); | |
$to_be_hashed = $strName . FRESHDESK_SHARED_SECRET . $strEmail . $timestamp; | |
$hash = hash_hmac('md5', $to_be_hashed, FRESHDESK_SHARED_SECRET); | |
return FRESHDESK_BASE_URL."login/sso/?name=".urlencode($strName)."&email=".urlencode($strEmail)."×tamp=".$timestamp."&hash=".$hash; | |
} |
OlderNewer