Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nathanroberts on github.
  • I am nathanroberts (https://keybase.io/nathanroberts) on keybase.
  • I have a public key ASAPlh7WOKCYlQ5IMaze-CfM1B5XvwBobSAYuLqGqQr3Ewo

To claim this, I am signing this object:

@nathanroberts
nathanroberts / ee-perms.sh
Last active December 27, 2015 14:59
EE Set Permissions Script
#!/bin/bash
# File permissions for a fresh Expression Engine 2.7.2 installation as presribed here:
# http://ellislab.com/expressionengine/user-guide/installation/installation.html
DIR=$(pwd)
chmod 666 $DIR/system/expressionengine/config/config.php
chmod 666 $DIR/system/expressionengine/config/database.php
@nathanroberts
nathanroberts / progress-bar.html
Created April 4, 2013 20:15
HTML/jQuery progress bar and steps sequence
<!doctype html>
<html lang="en">
<head>
<title>Progress Bar</title>
<style type="text/css">
/** * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/) * http://cssreset.com */html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary,time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline;}/* HTML5 display-role reset for older browsers */article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block;}body { line-height: 1;}ol, ul { list-style: none;}blockquote, q { quotes: none;}blockquote:
@nathanroberts
nathanroberts / gist:2996832
Created June 26, 2012 16:24
HAML template
%div{class: "row"}
%a{href: "/"}
%img{src: "images/misc/back.png", alt: "Back"}
%div{class: "row"}
%div{id: "featured"}
=@photos
@nathanroberts
nathanroberts / gist:2996827
Created June 26, 2012 16:22
Passing variables to a template in Sinatra
get "/kids" do
@photos =
"
<img src='images/catalog/kids_1.jpg' />
<img src='images/catalog/kids_2.jpg' />
<img src='images/catalog/kids_3.jpg' />
<img src='images/catalog/kids_4.jpg' />
<img src='images/catalog/kids_5.jpg' />
<img src='images/catalog/kids_6.jpg' />
<img src='images/catalog/kids_7.jpg' />
@nathanroberts
nathanroberts / between.rb
Created June 4, 2012 19:32
Find number of days between two dates
#! /usr/bin/ruby
require 'date'
def wrangler(x, y)
span = Date.parse(y) - Date.parse(x)
weeks = span.to_i / 7
puts "There are " + span.to_s + " days between " + x.chomp + " and " + y.chomp
puts "(about " + weeks.to_s + " weeks)"