Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Railton railto

View GitHub Profile
View keybase.md

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:

@railto
railto / drink.js
Created Sep 19, 2016
whatCanIDrink
View drink.js
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"
}
}
@railto
railto / playbook.yml
Created Sep 7, 2016 — forked from marklit/playbook.yml
Setup a load-balanced, two-node Django cluster
View playbook.yml
---
- name: SSH tightening
hosts: all
sudo: True
tasks:
- name: Disable root's ssh account
action: >
lineinfile
dest=/etc/ssh/sshd_config
View keybase.md

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:

@railto
railto / UserUpdateRequest.php
Last active Sep 22, 2015
Update user validation
View UserUpdateRequest.php
<?php
namespace App\Http\Requests;
use Illuminate\Support\Facades\Hash;
class UserUpdateRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
@railto
railto / sculpin_kernel.yml
Created Feb 17, 2015
Adding twig extension to sculpin - add to app/config/sculpin_kernel.yml
View sculpin_kernel.yml
services:
twig.extension.text:
class: Twig_Extensions_Extension_Text
tags:
- { name: twig.extension }
@railto
railto / publish.sh
Last active Aug 29, 2015
Sculpin publisher to github pages
View publish.sh
#!/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
@railto
railto / sculpin_kernel.yml
Created Dec 27, 2014
sculpin_kernel file
View sculpin_kernel.yml
sculpin_content_types:
posts:
permalink: blog/:filename/
sculpin_theme:
theme: sculpin/bootstrap-3-blog-theme
services:
twig.extension.text:
View Post.php
<?php
use Cviebrock\EloquentSluggable\SluggableInterface;
use Cviebrock\EloquentSluggable\SluggableTrait;
class Post extends Eloquent implements SluggableInterface {
protected $fillable = ['title', 'slug', 'user_id', 'content'];
use SluggableTrait;
@railto
railto / gist:66a2e0d910d47afd6d16
Last active Aug 29, 2015
Blog post model in laravel
View gist:66a2e0d910d47afd6d16
<?php
use Cviebrock\EloquentSluggable\SluggableInterface;
use Cviebrock\EloquentSluggable\SluggableTrait;
class Post extends Eloquent implements SluggableInterface {
protected $fillable = ['title', 'slug', 'user_id', 'content'];
use SluggableTrait;