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
server { | |
server_name [host]; | |
root /var/www/[document_root]; ## <-- Your only path reference. | |
# Enable compression, this will help if you have for instance advagg module | |
# by serving Gzip versions of the files. | |
gzip_static on; | |
location = /favicon.ico { |
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 | |
Class MyTest extends PHPUnit_Framework_TestCase { | |
static $pidfile = './.pidfile'; | |
static $serverHost = 'localhost'; | |
static $serverPort = '6767'; | |
public static function serverURL() | |
{ |
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 | |
/** | |
* @dataProvider generousDataProvider::giveMeInput() | |
*/ | |
public fucntion test_thy_feature($input) | |
{ | |
// Mock Job that make an external HTTP request | |
$mOperation = Mockery::mock(GetTheBeansOperation::class, [$input])->makePartial(); | |
$mOperation->shouldReceive('run') |
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
## | |
# | |
# setup: | |
# - generate an ssh key to be used as an authentication key with `ssh-keygen` and call it `docker_ssh_rsa` | |
# - make sure your current ssh agent has the identity file added | |
# - $ eval `ssh-agent` | |
# - $ ssh-add docker_ssh_rsa | |
# | |
# build: $ sudo docker build -t <you>/spvssh . | |
# |
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 | |
echo -n "GitHub User: " | |
read USER | |
echo -n "GitHub Password: " | |
read -s PASS | |
echo "" | |
echo -n "GitHub Repo (e.g. foo/bar): " |
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
import AVFoundation | |
import Foundation | |
// The maximum number of audio buffers in flight. Setting to two allows one | |
// buffer to be played while the next is being written. | |
private let kInFlightAudioBuffers: Int = 2 | |
// The number of audio samples per buffer. A lower value reduces latency for | |
// changes but requires more processing but increases the risk of being unable | |
// to fill the buffers in time. A setting of 1024 represents about 23ms of |
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
// Courtesy of http://php.net/manual/en/function.parse-url.php#114817 | |
/** | |
* UTF-8 aware parse_url() replacement. | |
* | |
* @return array | |
*/ | |
function mb_parse_url($url) | |
{ | |
$enc_url = preg_replace_callback( |
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 | |
# Copyright © 2017 Google Inc. | |
# 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 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 | |
class CreateArticleFeature extends Feature | |
{ | |
public function handle(Request $request) | |
{ | |
$this->run(new ValidateArticleInputForCreationJob($request->input())); | |
// process cover photo | |
$cover = $this->run(ProcessArticleCoverOperation::class); |
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 | |
class ProcessArticleCoverOperation extends Operation | |
{ | |
public function handle(Request $request) | |
{ | |
$photo = $this->run(MakePhotoFromDataJob::class, ['data' => $request->input('photo')]); | |
$this->run(new ValidateCoverPhotoDimensionsJob($photo)); | |
$variations = $this->run(new GeneratePhotoVariationsJob($photo)); | |
$uploads = $this->run(new UploadFilesToCdnJob($variations)); |
NewerOlder