Skip to content

Instantly share code, notes, and snippets.

View alexhartley's full-sized avatar

Alex Hartley alexhartley

View GitHub Profile
Modified from the gist @https://gist.github.com/odiumediae/3b22d09b62e9acb7788baf6fdbb77cf8
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim

Keybase proof

I hereby claim:

  • I am alexhartley on github.
  • I am alexhartley (https://keybase.io/alexhartley) on keybase.
  • I have a public key whose fingerprint is D3D6 5330 9D63 8220 E101 75BD 2131 3ADA 2822 7712

To claim this, I am signing this object:

class DCode
def initialize(assessment, user)
@assessment = assessment
@user = user
end
def code
"#{site.name[0,2]}-#{department_code}".upcase
end
@alexhartley
alexhartley / risk.rb
Created October 18, 2012 18:51 — forked from kylewelsby/risk.rb
Example for NWRUG visitor
require 'rspec'
class Risk
def code(user)
user_site = user.site[0..1]
if department
department_name = department.name[0..1]
end
[user_site,department_name,"001"].compact.join('-').upcase
@alexhartley
alexhartley / gemfile
Created October 6, 2012 16:58
Gem file for spree store
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.7'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
@alexhartley
alexhartley / Fullpage.html
Created June 19, 2012 14:19
Matt Hamm's Page Curl Boxes
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Matt Hamm's Page Curl Boxes &middot; CodePen</title>
<link rel="stylesheet" href="http://codepen.io/stylesheets/css/reset.css">
@alexhartley
alexhartley / Fullpage.html
Created June 19, 2012 14:16
Mobile First Grids
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mobile First Grids &middot; CodePen</title>
<link rel="stylesheet" href="http://codepen.io/stylesheets/css/normalize.css">
@alexhartley
alexhartley / Fullpage.html
Created June 19, 2012 14:16
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mobile First Grids &middot; CodePen</title>
<link rel="stylesheet" href="http://codepen.io/stylesheets/css/normalize.css">
@alexhartley
alexhartley / gist:2507426
Created April 27, 2012 08:28 — forked from dhh/gist:1975644
Rails Mass Assignment Protection
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@alexhartley
alexhartley / form_mail.php
Created March 12, 2012 13:25
Mail to Form
// Define some constants
define( "RECIPIENT_NAME", "John Smith" );
define( "RECIPIENT_EMAIL", "john@example.com" );
define( "EMAIL_SUBJECT", "Visitor Message" );
// Read the form values
$success = false;
$senderName = isset( $_POST['senderName'] ) ? preg_replace( "/[^\.\-\' a-zA-Z0-9]/", "", $_POST['senderName'] ) : "";
$senderEmail = isset( $_POST['senderEmail'] ) ? preg_replace( "/[^\.\-\_\@a-zA-Z0-9]/", "", $_POST['senderEmail'] ) : "";
$message = isset( $_POST['message'] ) ? preg_replace( "/(From:|To:|BCC:|CC:|Subject:|Content-Type:)/", "", $_POST['message'] ) : "";