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 | |
$drop = $this->getApplication()->get("doctrine:database:drop"); | |
$dropInput = new ArrayInput(array('--force' => '1'), $drop->getDefinition()); | |
$drop->execute($dropInput, $output); | |
?> |
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 HiveNet\BaseBundle\Form; | |
use Symfony\Component\Form\FormError; | |
use Symfony\Component\Form\FormInterface; | |
use Symfony\Component\Form\FormValidatorInterface; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilder; |
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
require "logstash/filters/base" | |
require "logstash/namespace" | |
# | |
# Filter plugin to normalize log levels from various logging frameworks | |
# | |
# The output field (log_level by default) will contain a number between | |
# 100 and 999, inclusive, with higher numbers indicating higher | |
# importance or severity. | |
# |
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
/** | |
* American Express card numbers start with 34 or 37 and have 15 digits. | |
*/ | |
'AMEX' => array( | |
'/^3[47][0-9]{13}$/' | |
), | |
/** | |
* China UnionPay cards start with 62 and have between 16 and 19 digits. | |
* Please note that these cards do not follow Luhn Algorithm as a checksum. | |
*/ |
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
if (current != null) { | |
Log.i("DEBUG", "top before: " + mProfileView.getTop()); | |
current.cancel(); | |
Log.i("DEBUG", "top after: " + mProfileView.getTop()); | |
current = null; | |
} | |
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
pm = dynamic | |
; The number of child processes to be created when pm is set to 'static' and the | |
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. | |
; This value sets the limit on the number of simultaneous requests that will be | |
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. | |
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP | |
; CGI. The below defaults are based on a server without much resources. Don't | |
; forget to tweak pm.* to fit your needs. | |
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' |
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
{ | |
"name": "symfony/framework-standard-edition", | |
"license": "MIT", | |
"type": "project", | |
"description": "The \"Symfony Standard Edition\" distribution", | |
"minimum-stability": "dev", | |
"autoload": { | |
"psr-0": { "": "src/", "SymfonyStandard": "app/" } | |
}, | |
"require": { |
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
# install ssh key on server | |
@task | |
def add_public_key(key_file="default.pub",key_type="openssh"): | |
with hide("running"): | |
key_abs_file = key_file | |
# 1st try | |
if not os.path.isfile(key_abs_file): | |
key_abs_file = os.getcwd() + "/" + key_file |
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
if (self._minifyTogether) { | |
var sources = _.map(self.js, function (file) { | |
return file.contents('utf8'); | |
}); | |
buildmessage.enterJob({title: "minifying"}, function () { | |
allJs = _minify(minifiers.UglifyJS, '', sources, minifyOptions).code; | |
}); | |
self.js = [new File({ info: 'minified js', data: new Buffer(allJs, 'utf8') })]; |
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
// proof of concept for promise chaining | |
function chain(obj) { | |
let stack = []; | |
let proxy = new Proxy(obj, { | |
get: (target, name, receiver) => { | |
if (name == 'finally' || name == "done") { | |
return function(callback) { | |
return replayStack(obj, stack, callback); | |
} |
OlderNewer