Implementation of the Node module resolution algorithm (aka require.resolve()) in PHP.
Depends on league/flysystem and illuminate/support.
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;Implementation of the Node module resolution algorithm (aka require.resolve()) in PHP.
Depends on league/flysystem and illuminate/support.
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;| <?php | |
| /** | |
| * 异常处理类 | |
| */ | |
| use \Illuminate\Contracts\Debug\ExceptionHandler; | |
| class MyQueueException implements ExceptionHandler | |
| { | |
| /** |
| (function () { | |
| 'use strict'; | |
| // Relevant resource: https://gist.github.com/spencermefford/bc73812f216e0e254ad1 | |
| module.exports = function (server, callback) { | |
| var ACL = server.models.ACL, | |
| User = server.models.User, | |
| Role = server.models.Role, | |
| RoleMapping = server.models.RoleMapping; |
| // Implementation in ES6 | |
| function pagination(c, m) { | |
| var current = c, | |
| last = m, | |
| delta = 2, | |
| left = current - delta, | |
| right = current + delta + 1, | |
| range = [], | |
| rangeWithDots = [], | |
| l; |
This is my upload-file type for what I use at work. We use angular-upload for the upload service to do the actual file uploading. We also have several abstractions and use ES6 that may confuse you a little bit (sorry about that). Hopefully this gets you started though.
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| /** @jsx React.DOM */ | |
| var STATES = [ | |
| 'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', | |
| 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', | |
| 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', | |
| 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY' | |
| ] | |
| var Example = React.createClass({ |
| dependencies[] = ctools | |
| ; Views Handlers | |
| files[] = views/mymodule_handler_handlername.inc |
| #!/bin/bash | |
| # __ | |
| # _____ ____ _/ |_ ____ ____ _______ | |
| # / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \ | |
| # | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/ | |
| # |__|_| / \___ > |__| \___ > \____/ |__| | |
| # \/ \/ \/ | |
| # | |
| # .___ | |
| # __| _/ __ __ _____ ______ |
| do -> | |
| core = APP.ns 'core' | |
| Model = core.Model | |
| singletonManagers = {} | |
| ### | |
| Base class for models that represent Mongo documents. |