Skip to content

Instantly share code, notes, and snippets.

View lukemorton's full-sized avatar

Luke Morton lukemorton

View GitHub Profile

Vagrant SSH Helper

This is specifically for https://github.com/madebymade/vagrant-dev

Usage

Inside your vagrant-dev directory you might run your tests normally like this:

vagrant ssh -c "cd /var/www/my-project && rake"
@lukemorton
lukemorton / config.fish
Last active August 29, 2015 13:56
Fish Config
function g; git $argv; end
function ll; ls -laH $argv; end
set fish_user_paths $fish_user_paths ~/Repositories/adt/sdk/platform-tools
set fish_user_paths $fish_user_paths ~/Repositories/adt/sdk/tools
function _git_branch_name
set -l branch (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
@lukemorton
lukemorton / la-notte-italiana.md
Last active August 29, 2015 13:56
Italian Menu for Tomorrow

La notte italiana

Hosted by Luke Morton

Aperitif

Aperol Spritz

Olive

class ParentView extends Uniform
constructor: (settings) ->
if settings.el
return unless settings.el.length?
super
elements: (add) ->
add('component_one', '.component-one')
add('component_two', '.component-two')
class BaseView extends Uniform
constructor: (settings) ->
if settings.el
return unless settings.el.length?
super
class SiteView extends Uniform
init: ->
switch @el.data('view')
when "index":
new IndexView(el: @selielte)
when "about":
new AboutView(el: @el)
when "contact":
new ContactView(el: @el)
module YdtdFrontend
module MailerHelper
def spacer(width, height)
image_tag('email/spacer.gif',
:alt => " ",
:height => width,
:width => height,
:style => "display:block;")
end
@lukemorton
lukemorton / BlogController.php
Last active August 29, 2015 13:57
Vision of controller future
<?php
namespace App;
class PostController
{
use DependencyHelper; // Includes ::inject()
use TemplateEngineHelper; // Includes ::render()
use ResponseHelper; // Includes ::redirect()
use ArrayHelper; // Includes ::arr_get()
function getAlphabet() {
return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
}
function hasLetterFn(str) {
str = str.toUpperCase();
return function (isPangram, letter) {
return isPangram && (str.indexOf(letter) > -1);
}
require 'lily/adapter/rack'
require 'lily/application/routed_application'
handler = RoutedApplication.new(:routes => [[:GET, '/', 'Hello world']])
run Lily::Adapter::Rack::Handler.new(:handler => handler)
# Or closer to PHP version: Lily::Adapter::Rack.new(:runner => method(:run)).run(:handler => handler)