Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| $num_workers = 5; | |
| $pid = 1; | |
| for($i = 0; $i < $num_workers; $i++) { | |
| $pid = pcntl_fork(); | |
| if($pid == 0) { | |
| break; | |
| } | |
| } |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| class Process_Manager implements Countable | |
| { | |
| protected $processes = array(); | |
| protected $is_child = FALSE; | |
| public function count() | |
| { | |
| return count($this->processes); |
| public static function isAssoc(array $arr) | |
| { | |
| return array_keys($arr) !== range(0, count($arr) - 1); | |
| } |
| angular.module('testApp', []). | |
| directive('lazyLoad', ['$window', '$q', function ($window, $q) { | |
| function load_script() { | |
| var s = document.createElement('script'); // use global document since Angular's $document is weak | |
| s.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize'; | |
| document.body.appendChild(s); | |
| } | |
| function lazyLoadApi(key) { | |
| var deferred = $q.defer(); | |
| $window.initialize = function () { |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
| console.log(1); | |
| (_ => console.log(2))(); | |
| eval('console.log(3);'); | |
| console.log.call(null, 4); | |
| console.log.apply(null, [5]); | |
| new Function('console.log(6)')(); | |
| Reflect.apply(console.log, null, [7]) | |
| Reflect.construct(function(){console.log(8)}, []); | |
| Function.prototype.apply.call(console.log, null, [9]); | |
| Function.prototype.call.call(console.log, null, 10); |
| [[constraint]] | |
| name="k8s.io/apimachinery" | |
| revision="1fd2e63a9a370677308a42f24fd40c86438afddf" | |
| [[constraint]] | |
| name="k8s.io/client-go" | |
| branch="release-4.0" |