Requires installed gitolite in /home/git and following directory structure
/var
/www
/apps
/hosts
/libs
/** | |
* Startup | |
*/ | |
public function startup() | |
{ | |
parent::startup(); | |
// plain text output when http request | |
$this->getHttpResponse()->setContentType('text/plain'); |
<?php | |
ob_start(function($s, $flag) { | |
if ($flag & PHP_OUTPUT_HANDLER_START) { | |
$e = new \Exception; | |
$s = nl2br("Output started here:\n{$e->getTraceAsString()}\n\n") . $s; | |
} | |
return $s; | |
}, 2); |
<?php | |
$user = $connection->repository('user')->get(1); | |
// $user instanceof Row | |
$users = $connection->repository('user')->query()->where('id in ?', [1, 2, 3]); | |
// $users instanceof SqlBuilder | |
$users = $connection->repository('user')->query()->where('id in ?', [1, 2, 3])->getSelection(); | |
// $users instanceof Selection |
<?php | |
class Article extends Base { | |
function getUploadDir() { | |
# e.g. something like this | |
return "upload/articles/article-$this[id]"; | |
} | |
} |
<?php | |
namespace Vondra; | |
class GitBranchPanel implements \Nette\Diagnostics\IBarPanel | |
{ | |
public function getPanel() | |
{ | |
return ''; |
i386 : iPhone Simulator | |
x86_64 : iPhone Simulator | |
arm64 : iPhone Simulator | |
iPhone1,1 : iPhone | |
iPhone1,2 : iPhone 3G | |
iPhone2,1 : iPhone 3GS | |
iPhone3,1 : iPhone 4 | |
iPhone3,2 : iPhone 4 GSM Rev A | |
iPhone3,3 : iPhone 4 CDMA | |
iPhone4,1 : iPhone 4S |
#!/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 |
<?php | |
namespace SmartCMS; | |
use Nette, | |
Nette\Utils\Html; | |
class BootstrapHorizontalFormRenderer extends Nette\Forms\Rendering\DefaultFormRenderer | |
{ | |
public $wrappers = array( |
location /resize { | |
alias /tmp/nginx/resize; | |
set $width 150; | |
set $height 100; | |
set $dimens ""; | |
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
set $width $1; | |
set $height $2; | |
set $image_path $3; |