Skip to content

Instantly share code, notes, and snippets.

View frankdejonge's full-sized avatar

Frank de Jonge frankdejonge

View GitHub Profile
@frankdejonge
frankdejonge / Envoy.blade.php
Created August 23, 2014 15:59
Envoy server at a non-standard port
@servers(['web' => 'user@example.com -p 1234'])
@task('deploy', ['on' => 'web'])
ls -la
@endtask
@frankdejonge
frankdejonge / composer.json
Created September 24, 2014 16:48
PSR-0 folder structure with PSR-4 autoloading.
{
"autoload": {
"psr-4": {
"Vendor\\Package\\": "src/Vendor/Package"
}
}
}
@frankdejonge
frankdejonge / example.php
Created September 30, 2014 12:21
Call forwarding with interfaces and argument unpacking and the splat operator.
<?php
interface SomeInterface
{
public function forwardedCall($argument);
}
class Pre56BreakingInterface implements SomeInterface
{
public function forwardedCall()
@frankdejonge
frankdejonge / gulpfile.js
Created October 6, 2014 13:37
Basic Gulp setup with Sass + Bower + Browserify
var gulp = require('gulp'),
browserify = require('gulp-browserify'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
jshint = require('gulp-jshint');
gulp.task('javascript', function () {
return gulp.src('assets/js/*.js')
.pipe(browserify({
@frankdejonge
frankdejonge / example.php
Created October 31, 2014 15:01
Flysystem Download from FTP
<?php
$ftp = new League\Flysystem\Filesystem(new League\Flysystem\Adapter\Ftp($settings));
$local = new League\Flysystem\Filesystem(new League\Flysystem\Adapter\Local($path));
$local->write($destination, $ftp->read($source));
@frankdejonge
frankdejonge / example.php
Created November 5, 2014 21:29
Write to dropbox example
<?php
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Dropbox;
use League\Flysystem\Adapter\Local;
$dropbox = new Filesystem(new Dropbox($client, 'dropbox/root/dir'));
$local = new Filesystem(new Local('loca/root/path'));
$dropbox->write('destination.ext', $local->read('relative/path/to/file.ext'));
@frankdejonge
frankdejonge / example.php
Created November 11, 2014 20:31
AWS SDK v3 s3Client setup
<?php
$client = S3Client::factory([
'key' => '...',
'secret' => '...',
'region' => 'eu-west-1',
'version' => 'latest',
'debug' => true,
]);
<?php
function append_to_file($location, $contents)
{
$handle = fopen($location, 'a');
defer fclose($handle);
// stuff stuff
frwite($handle, $contents);
}
<?php
class DomainListener
{
public function handle(EventInterface $event)
{
// PASS
}
public function handle(DomainEvent $event)
@frankdejonge
frankdejonge / failing-composer.json
Created April 7, 2015 14:04
Require doctrine/mbongodb without ext-mongo
{
"name": "frankdejonge/tester",
"require": {
"doctrine/mongodb": "*"
},
"minimun-stability": "dev",
"prefer-stable": true
}