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 Silex\Application; | |
use Silex\ServiceProviderInterface; | |
use Illuminate\Database\Capsule\Manager as Capsule; | |
use Illuminate\Events\Dispatcher; | |
use Illuminate\Container\Container; | |
use Illuminate\Cache\CacheManager; | |
class CapsuleServiceProvider implements ServiceProviderInterface | |
{ |
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 | |
$url = 'http://maps.googleapis.com/maps/api/staticmap?'; | |
$bits = array( | |
'center' => 'Calgary Tower, Calgary, AB, Canada', | |
'zoom' => '16', | |
'size' => '800x600', | |
'maptype' => 'roadmap', | |
'markers' => 'color:0x576d4e|label:N|49.6967179,-112.8450119', | |
'sensor' => 'false', | |
); |
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
/** | |
* Command: casperjs chomecast-bgs.js [DIR] [START] [END] | |
* Examples: casperjs chomecast-bgs.js ~/Downloads/Chromecast | |
* casperjs chomecast-bgs.js ~/Downloads/Chromecast 25 | |
* casperjs chomecast-bgs.js ~/Downloads/Chromecast 25 35 | |
* | |
* Note: [DIR] (Required) The directory to download. This must exist, it won't be created. | |
* [START] (Optional) Start is the image number to start from, incase the script fails and needs to be restarted. | |
* [END] (Optional) End is the image number to finish at, if you only want a specific range of images. | |
*/ |
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
#! /usr/bin/env ruby | |
# Cleanup Plesk 10.3 Log Files | |
# A handy little script to truncate Plesk log files. | |
# Useful for when you change the subscription log rotation settings. | |
# Make sure you backup your log files beforehand. | |
# | |
# Usage: | |
# ruby cleanup-plesk-logs.rb /var/www/vhosts | |
# ruby cleanup-plesk-logs.rb /var/www/vhosts -f |
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
#!/usr/bin/env ruby | |
# Merge Audiobook MP3s | |
# This script will iterate through directories of audiobooks, | |
# combine the MP3 files and output the new file to a destination directory. | |
# | |
# Usage: ruby audiobook_merge.rb [SRC] [DEST] | |
# Example: ruby audiobook_merge.rb /audiobooks /audiobooks/combined | |
abort "Could not locate the 'cat' binary on your computer." if `which cat`.empty? |
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'; | |
use Symfony\Component\Console\Application; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputOption; | |
use Phpmig\Console\Command\CheckCommand; | |
use Phpmig\Console\Command\DownCommand; |
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 Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\HttpFoundation\File\UploadedFile; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Symfony\Component\Form\FormEvent; | |
use Symfony\Component\Form\FormEvents; | |
class CreateForm extends AbstractType | |
{ |
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 | |
/** | |
* A simple wrapper around Aura Input. | |
*/ | |
use Aura\Input\Form; | |
use Aura\Input\Builder; | |
use Aura\Input\Filter; | |
use Aura\Html\HelperLocatorFactory; | |
use Aura\Filter\FilterFactory; |
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
# Nginx FastCGI Cache: http://seravo.fi/2013/optimizing-web-server-performance-with-nginx-and-php | |
# More Caching: https://www.digitalocean.com/community/tutorials/how-to-setup-fastcgi-caching-with-nginx-on-your-vps | |
# Apache Bench Mac: http://kevify.com/2013/ab-on-mac/ | |
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=MYAPP:100m inactive=60m; | |
fastcgi_cache_key "$scheme$request_method$host$request_uri"; | |
server { | |
listen 80; |