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": { | |
"mfacenet/hello-world": "v1.*" | |
} | |
} |
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
#!/bin/sh | |
# download | |
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.4.zip | |
# unzip and start | |
unzip elasticsearch-0.20.4.zip | |
cd elasticsearch-0.20.4 | |
# remove data in case you have defined some analyzers in the past (e.g. stop/start) | |
rm -rf data/ |
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 Gedmo; | |
use Doctrine\Common\Annotations\AnnotationRegistry; | |
use Doctrine\ORM\Mapping\Driver as DriverMappingORM; | |
use Doctrine\Common\Persistence\Mapping\Driver as DriverORM; | |
use Doctrine\ODM\MongoDB\Mapping\Driver as DriverMongodbODM; | |
use Doctrine\Common\Annotations\Reader; | |
use Doctrine\Common\Annotations\CachedReader; |
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
# Quick hack of regular expressions to convert twitter bootstrap from LESS to Stylus | |
less2stylus = (string) -> | |
string = string | |
.replace(/^(\ *)(.+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
.replace(/^(\ *)([^\ \n]+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
.replace(/\ *\{\ *\n*/g, "\n") # remove opening brackets again (some random cases I'm too lazy to think through) | |
.replace(/\ *\}\ *\n*/g, "\n") # remove closing brackets | |
.replace(/\;\ *?$/gm, "") # remove semicolons | |
.replace(/@(\w+):(\ *)\ /g, (_, $1, $2) -> # replace @variable: with $variable = | |
"$#{$1}#{$2} = " |
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
#!/bin/bash | |
current_branch="$(git symbolic-ref HEAD 2>/dev/null)" || current_branch="(unknown)" | |
current_branch=${current_branch##refs/heads/} | |
github_username="JanTvrdik" | |
github_token="..." | |
if [[ $current_branch = "(unknown)" ]] | |
then |
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
/** | |
* Live Form Validation for Nette 2.0 | |
* | |
* @author Radek Ježdík, MartyIX, David Grudl | |
*/ | |
var LiveForm = { | |
options: { | |
controlErrorClass: 'form-control-error', // CSS class for an invalid control | |
errorMessageClass: 'form-error-message', // CSS class for an error message |
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 | |
public function createComponent($name) | |
{ | |
$ucname = ucfirst($name); | |
$method = 'createComponent' . $ucname; | |
if ($ucname !== $name && method_exists($this, $method)) { | |
$reflection = $this->getReflection()->getMethod($method); | |
if($reflection->getName() !== $method) { | |
return; | |
} |
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
/** | |
* @author Jan Marek | |
* | |
* @method QueryBuilderBuilder andWhere() andWhere(\mixed $where) | |
* @method QueryBuilderBuilder orderBy() orderBy(\string $sort, \string $order = null) | |
* @method QueryBuilderBuilder from() from(\string $from, \string $alias, \string $indexBy = null) | |
* @method QueryBuilderBuilder select() select(\string $select = null) | |
* @method QueryBuilderBuilder addSelect() addSelect(\string $select = null) | |
* @method QueryBuilderBuilder setMaxResults() setMaxResults(\int $maxResults) | |
* @method QueryBuilderBuilder setFirstResult() setFirstResult(\int $firstResults) |
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 VojtechDobes\NetteSecurity; | |
use Nette\InvalidArgumentException; | |
use Nette\Security\IAuthenticator; | |
use Nette\Security\IIdentity; | |
/** |
NewerOlder