Skip to content

Instantly share code, notes, and snippets.

@wujku
wujku / osx-10.11-setup.md
Created November 17, 2015 21:35 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

<?php
/*
* Get value from array by path
* Example:
* $a = ['customer' => ['address' => 'St. Jork', 'city' => 'Miami']]
*
* getByPath($a, 'customer.address')
*/
function getByPath($array, $path) {
@wujku
wujku / generateCSV.php
Created January 27, 2016 11:33
Simple CSV creator for Symfony Framework
<?php
use Symfony\Component\HttpFoundation\StreamedResponse;
/**
* @param $array
* @param $columns ['path.to.value' => 'Column name', 'path.val' => 'Col 2']
* @param $filename
* @return StreamedResponse
*/
@wujku
wujku / Vagrantfile.rb
Created April 18, 2016 06:34
Simple vagrant configuration
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = 2
vb.name = "vm"
LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php
apt-get update -y
apt-get install -y \
php7.0-fpm \
php7.0-intl \
php7.0-cli \
php7.0-json \
php7.0-readline \
php7.0-curl \
LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php5-5.6
apt-get update -y
apt-get install -y \
php5.6-fpm \
php5.6-intl \
php5.6-cli \
php5.6-json \
php5.6-readline \
php5.6-curl \
$(this).on('change', '.folder-select', function (event) {
var $this = $(this);
var selected_mailbox = $this.val();
$('.folder-select').not($this).filter(function( index ) {
return $(this).val() === selected_mailbox;
}).each(function () {
$(this).val('');
});
});
@wujku
wujku / BooleanType.php
Created April 5, 2017 13:17 — forked from fsevestre/BooleanType.php
Boolean form type for Symfony2 + tests
<?php
namespace AppBundle\Form\Type;
use AppBundle\Form\DataTransformer\BooleanTypeToBooleanTransformer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class BooleanType extends AbstractType
@wujku
wujku / Ageno.pl_Code_Style.xml
Last active April 19, 2017 09:45
Code style for PHPStorm IDE
<code_scheme name="Ageno.pl_Code_Style">
<PHPCodeStyleSettings>
<option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
<option name="LOWER_CASE_NULL_CONST" value="true" />
<option name="ELSE_IF_STYLE" value="COMBINE" />
<option name="BLANK_LINE_BEFORE_RETURN_STATEMENT" value="true" />
<option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
<option name="SPACE_AFTER_UNARY_NOT" value="true" />
<option name="FORCE_SHORT_DECLARATION_ARRAY_STYLE" value="true" />
location @cache_resolve {
return 301 /media/cache/resolve/$1;
}
location ~ ^/media/cache/(?!resolve/)(.*) {
root /var/www/public_html;
try_files $uri @cache_resolve;
}