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
input { | |
tcp { | |
type => "nginx" | |
port => 3333 | |
} | |
} | |
filter { | |
grok { | |
type => "nginx" |
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
class File | |
__construct($filename) | |
$this->workingCopy = new WorkingCopy($filename) | |
hasWorkingCopy() | |
return $this->workingCopy && $this->workingCopy->exists() | |
getWorkingCopy() | |
if (!$this->hasWorkingCopy()) | |
$this->workingCopy = new WorkingCopy(Storage::download($this->id)) | |
return $this->workingCopy |
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
alias codecept='() { vagrant ssh -c "cd /vagrant/www && vendor/bin/codecept $*" }' | |
alias composer='() { vagrant ssh -c "cd /vagrant/www && composer $*" }' |
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 | |
$city = DB::createQueryBuilder('Ni\City') | |
->field('coordinates')->geoNear(46.1643154116, 18.9664363861) | |
->spherical(true) | |
->distanceMultiplier(6378.137) // rad => km | |
->limit(1) | |
->getQuery() | |
->getSingleResult(); |
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 | |
use GeoJson\Geometry\Point; | |
$city = new City; | |
$city->name = 'Budapest'; | |
$city->coordinates = new Coordinates(47.51, 19.03); | |
$city->save(); | |
$city = DB::createQueryBuilder('City') |
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 | |
old_head="$1" | |
new_head="$2" | |
branch_switch="$3" | |
git_root=$(git rev-parse --show-toplevel) | |
git diff --name-only $new_head $old_head | grep composer.lock > /dev/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
function! TigStatus() | |
silent !tig status | |
redraw! | |
endfunction | |
nnoremap <silent> gs :call TigStatus()<CR> |
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 the secondary address isn't specified or is specified as 0 (e.g. LOAD "FILE",8), the file is saved/loaded from the BASIC memory area (which, on the C64, starts by default at $0801). If the secondary address is specified as a non-zero value (e.g. LOAD "FILE",8,1), the program is loaded starting from the address specified by the file itself (the PRG header, which is the first two bytes of the file)—this form of command is more common when loading machine code programs. |
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 | |
$img = imagecreatetruecolor(640, 480); | |
$rot = imagerotate($img, -90, 0); | |
var_dump(imagesy($rot)); |
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 | |
require __DIR__ . '/vendor/autoload.php'; | |
$credentials_path = __DIR__ . '/credentials.json'; | |
putenv("GOOGLE_APPLICATION_CREDENTIALS=$credentials_path"); | |
$client = new Google_Client; | |
$client->useApplicationDefaultCredentials(); |
OlderNewer