Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mrailton's full-sized avatar

Mark Railton mrailton

View GitHub Profile

Keybase proof

I hereby claim:

  • I am railto on github.
  • I am railto (https://keybase.io/railto) on keybase.
  • I have a public key ASCtzTVjKcr4K0USfJygKE0JZdlZNDjVNyHNqxY4mZ1g_go

To claim this, I am signing this object:

@mrailton
mrailton / drink.js
Created September 19, 2016 20:28
whatCanIDrink
function whatCanIDrink(age) {
if (age < 0) {
return "Sorry. I can’t tell what drink because that age is incorrect!";
} else if (age < 14) {
return "Drink Toddy"
} else if (age < 18) {
return "Drink Coke"
}
}
@mrailton
mrailton / playbook.yml
Created September 7, 2016 08:26 — forked from marklit/playbook.yml
Setup a load-balanced, two-node Django cluster
---
- name: SSH tightening
hosts: all
sudo: True
tasks:
- name: Disable root's ssh account
action: >
lineinfile
dest=/etc/ssh/sshd_config

Keybase proof

I hereby claim:

  • I am railto on github.
  • I am railto (https://keybase.io/railto) on keybase.
  • I have a public key ASBuqYBAolnqsPlfJreo5_C1aGJMLFREkhFXE8hi-pUqmgo

To claim this, I am signing this object:

@mrailton
mrailton / UserUpdateRequest.php
Last active September 22, 2015 09:01
Update user validation
<?php
namespace App\Http\Requests;
use Illuminate\Support\Facades\Hash;
class UserUpdateRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
@mrailton
mrailton / sculpin_kernel.yml
Created February 17, 2015 14:25
Adding twig extension to sculpin - add to app/config/sculpin_kernel.yml
services:
twig.extension.text:
class: Twig_Extensions_Extension_Text
tags:
- { name: twig.extension }
@mrailton
mrailton / publish.sh
Last active August 29, 2015 14:12
Sculpin publisher to github pages
#!/bin/bash
# Custom sculpin publishing file
# Mark Railton - marksrailton@gmail.com
if (( $# != 1 ))
then
echo "You must enter a commit message as an argument"
exit 1
fi
@mrailton
mrailton / sculpin_kernel.yml
Created December 27, 2014 17:33
sculpin_kernel file
sculpin_content_types:
posts:
permalink: blog/:filename/
sculpin_theme:
theme: sculpin/bootstrap-3-blog-theme
services:
twig.extension.text:
<?php
use Cviebrock\EloquentSluggable\SluggableInterface;
use Cviebrock\EloquentSluggable\SluggableTrait;
class Post extends Eloquent implements SluggableInterface {
protected $fillable = ['title', 'slug', 'user_id', 'content'];
use SluggableTrait;
@mrailton
mrailton / gist:66a2e0d910d47afd6d16
Last active August 29, 2015 14:06
Blog post model in laravel
<?php
use Cviebrock\EloquentSluggable\SluggableInterface;
use Cviebrock\EloquentSluggable\SluggableTrait;
class Post extends Eloquent implements SluggableInterface {
protected $fillable = ['title', 'slug', 'user_id', 'content'];
use SluggableTrait;