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 | |
class JobManagerWrapper { | |
public function __call($method, $args) | |
{ | |
$instance = App::make('JobManager'); | |
return call_user_func_array([$instance, $job], $args); | |
} | |
} |
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 | |
class Session { | |
public function __construct(StorageInterface $storage) | |
{ | |
$this->storage = $storage; | |
} | |
} | |
class RedisStorage implments StorageInterface {} |
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 | |
foreach($collection as $key => $item){ | |
if(is_array($item)){ | |
foreach($item as $tree => $treeItem){ | |
if($tree != 'phones'){ | |
unset($item[$tree]) | |
} | |
} | |
} |
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
array(2) { | |
[0] array(7) { | |
["phone_number"] 91212345678 | |
["creator_id"] 53 | |
["description"] "number 1" | |
["priority"] 0 | |
["shared"] true | |
["phones"] array(1) { | |
["phone_number"] 91212345678 | |
} |
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 Bigsinoos\Helpers; | |
class TreeFilter { | |
/** | |
* Get only some variables of a tow-level nested array | |
* | |
* @param $filterable | |
* @param array $keep | |
* @return array | |
*/ |
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
[{ | |
"_id" : ObjectId("550d2255d2ea07ae148b456d"), | |
"comments" : [ | |
{ | |
"_id" : ObjectId("550d2255d2ea07ae148b4567"), | |
"title" : "salam comment 1", | |
"body" : "salam comment matn 1", | |
"cid" : 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
public class Loop { | |
public static void main(String[] args) | |
{ | |
Integer total = 500000000; | |
Integer chunk = 50000000; | |
Integer i = 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
'use strict'; | |
var redis = require('redis'); | |
var LaravelJob = require('./index'); | |
// Create laravel job instance | |
var job = new LaravelJob({}); | |
// Set handlers on the job | |
job.registerHandler("Jobinja\\Jobs\\ExampleJob", function(job, payload) { | |
console.log(payload); |
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 | |
require_once 'recipe/common.php'; | |
// A deploy script for for deployer.org used at Jobinja.ir | |
// The script creates a folder for each one of your releases | |
// and makes them zero downtime deploys, this is tuned for laravel | |
// but the logic can be used for anything which needed transactional folder | |
// based changes. | |
// As some of the npm packages are banned in our server ISP we use | |
// a combination of shadowsocks and polipo(for reversing https and socks) |
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 | |
class UserController { | |
public function postCreate(UserCreatorService $userCreatorService, Request $request) | |
{ | |
$creationNeeds = new CreationValueObject; | |
$creationNeeds->username = $request->username; | |
$creationNeeds->password = $request->password; | |
$creationNeeds->email = $request->email; |