A Brief Introduction to Multi-Threading in PHP
- Foreword
- Execution
- Sharing
- Synchronization
- Pitfalls
<?php | |
// src/Foobar/Controller/FooController.php | |
namespace Foobar\Controller; | |
class FooController | |
{ | |
public function helloAction($request) | |
{ |
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough banksean@gmail.com | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough banksean@gmail.com | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
authRouteProvider.$inject = ['$routeProvider']; | |
function authRouteProvider ($routeProvider) { | |
/** | |
* Creates a controller bound to the route, or wraps the controller in param | |
* so the authentication check is run before the original controller is executed | |
* @param currentController | |
* @return {Function} The wrapper controller | |
*/ | |
function redirectCtrlFactory (currentController) { | |
_ctrl.$inject = ['currentUser__', 'userRole__', '$location']; |
Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
var colors = ['#580201','#d9bd6a','#d9d49a','#037f8b','#025e73']; | |
var elems = []; | |
var body = document.getElementsByTagName('body')[0]; | |
var xElems = window.innerWidth/30, | |
yElems = body.clientHeight/10, | |
fragment = document.createDocumentFragment(); | |
for(var j = 0 ; j<yElems;j++){ |
arr = Array:: | |
arrSlice = arr.slice | |
curry = -> | |
args = arrSlice.call arguments | |
-> | |
args2 = arrSlice.call arguments | |
args[0].apply @, args.slice(1).concat(args2) | |
sum = -> |
==================================================================== | |
Simple-as-possible instructions to add a field (or more) using South | |
to an existing Django model with existing data. | |
==================================================================== | |
Two versions: | |
1. Super-condensed (the bare minimum - jfdi) | |
2. Detailed-but-brief (if you want more information). | |
Notes: |