Skip to content

Instantly share code, notes, and snippets.

@adamelso
adamelso / Vagrantfile
Last active August 29, 2015 13:55
Facebook HHVM, Vagrant, Ubuntu 13.10, Symfony2
# -*- mode: ruby -*-
# vi: set ft=ruby :
# ./Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "saucy64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.network :forwarded_port, guest: 80, host: 8090
@adamelso
adamelso / install_all_the_things.sh
Last active August 29, 2015 13:56
Mac Web Developer Setup
#!/bin/bash
###
### One assumes OS X Mavericks (10.9) is installed.
###
### By the way, don't rely too heavily on this Gist, this was
### written mostly for myself. For me, it was a way of note-taking.
### However, eventually I'll have this complete and working.
### to be used by others.
###
@adamelso
adamelso / Headers.php
Created March 7, 2014 16:15
Http\Headers
<?php
namespace ArchFizz\Http;
final class Headers
{
const HTTP_ACCEPT = 'Accept';
const HTTP_ACCEPT_CHARSET = 'Accept-Charset';
const HTTP_ACCEPT_ENCODING = 'Accept-Encoding';
const HTTP_ACCEPT_LANGUAGE = 'Accept-Language';
<?php
namespace ArchFizz\Gpx;
use Doctrine\Common\Collections\ArrayCollection;
class Coordinate
{
private $latitude;
private $longitude;
@adamelso
adamelso / GreekTranslatorSpec.php
Last active August 29, 2015 14:02
Creating a fake Translator with Spec Behaviour Driven Development using PhpSpec
<?php
namespace spec\FakeTranslator;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class GreekTranslatorSpec extends ObjectBehavior
{
function it_is_a_translator()
@adamelso
adamelso / SassMeister-input.scss
Created August 14, 2014 09:07
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
$feelunique-color-teal: #b3cac4;
$feelunique-color-cool-teal: #b3c9c6;
$feelunique-color-turquoise: #1abc9c;
$feelunique-color-blush-red: #d72245;
$feelunique-color-off-white: #f5f1f0;
@adamelso
adamelso / deploy.rb
Last active August 29, 2015 14:08 — forked from jmather/deploy.rb
after "deploy", "deploy:cleanup"
after "deploy:update_code", "composer:install"
before "composer:install", "composer:copy_vendors"
after "composer:install", "phpunit:run_tests"
namespace :composer do
desc "Copy vendors from previous release"
task :copy_vendors, :except => { :no_release => true } do
run "if [ -d #{previous_release}/vendor ]; then cp -a #{previous_release}/vendor #{latest_release}/vendor; fi"
end
<?php
namespace ArchFizz\WhateverBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Helper\DebugFormatterHelper;
use Symfony\Component\Console\Helper\ProcessHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@adamelso
adamelso / platform-sh-inactive-branch-removal.js
Created March 10, 2016 12:15
Remove inactive branch environments from Platform.sh
var deleteBranches = function () {
return $("ul[ng-show='environment.active_trail']")
.first()
.find("li.disabled > div > a")
.map(function (i, b) {
return b.text;
});
};
var filterDeleteBranchesByPrefix = function (prefix) {
@adamelso
adamelso / _example.sh
Last active November 3, 2020 13:28
Delete inactive branches from Platform.sh - Edit to your own needs
./plaform-inactive.sh delete