This file contains hidden or 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 | |
| $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 |
This file contains hidden or 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 | |
| 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); |
This file contains hidden or 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
| /** | |
| * Startup | |
| */ | |
| public function startup() | |
| { | |
| parent::startup(); | |
| // plain text output when http request | |
| $this->getHttpResponse()->setContentType('text/plain'); |
This file contains hidden or 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
| server { | |
| listen 80; | |
| server_name example.com; | |
| root d:/webs/example.com/www; | |
| index index.php index.html; | |
| try_files $uri $uri/ /index.php?$args; | |
| location ~ \.phpt?$ { | |
| try_files $uri @missing; |
This file contains hidden or 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
| pub mod cv { | |
| extern crate libc; | |
| use self::libc::{c_char, c_double, c_int, c_schar, c_void}; | |
| #[repr(C)] | |
| pub struct HaarClassifierCascade; | |
| #[repr(C)] | |
| pub struct MemStorage; |
This file contains hidden or 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 | |
| use Nette\Application\UI\Presenter; | |
| use Nette\DI\CompilerExtension; | |
| /** | |
| * Auto register presenters as services | |
| * @author Martin Bažík <martin@bazo.sk> |
This file contains hidden or 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
| /* | |
| * Copyright (C) 2014 skyfish.jy@gmail.com | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
| # put this in ~/.bashrc | |
| export SSH_AUTH_SOCK=/tmp/.ssh-socket | |
| ssh-add -l > /dev/null | |
| if [ $? = 2 ]; then | |
| rm -f $SSH_AUTH_SOCK | |
| echo Starting new ssh-agent... | |
| eval $(ssh-agent -a $SSH_AUTH_SOCK) > /dev/null | |
| ssh-add && echo "ssh-agent set up successfully with the following keys:" && ssh-add -l | |
| fi |
This file contains hidden or 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
| { | |
| "methodCalls": [ | |
| { | |
| "class": "\\Mockery", | |
| "method": "mock", | |
| "position": 0, | |
| "mask": "%s|\\Mockery\\MockInterface" | |
| }, | |
| { | |
| "class": "\\Nette\\DI\\Container", |
This file contains hidden or 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
| sudo openssl pkcs12 -export -in /etc/letsencrypt/live/domain.com/fullchain.pem -inkey /etc/letsencrypt/live/domain.com/privkey.pem -out domain.com.pfx |