Skip to content

Instantly share code, notes, and snippets.

View ebinion's full-sized avatar

Zeke Binion ebinion

View GitHub Profile
@ebinion
ebinion / gist:2569695
Created May 1, 2012 17:09
New form style Rails
<h1 id="edit_the_">Edit the <%= @line.name %></h1>
<%= form_for @line do |form| %>
<%= form.label :name, "Name of this train" %>
<%= form.text_field :name %>
<%= form.label :frequency, "Frequency of this train line" %>
<%= form.text_field :frequency %>
<% end %>
@ebinion
ebinion / Mail To.html
Last active October 11, 2015 21:27
Mailto with starter text
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Testing Shit</title>
<link rel="stylesheet" href="style.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
</head>
<body>
<h1>Yeah, Let's get this party started.</h1>
@ebinion
ebinion / Wordpress Edited Nav Menu Walker Class.php
Last active December 16, 2015 18:39
Custom walker for nav menus, I personally don't like having a million classes added to my html. So all the fluff is cut. You'll still have access to the menu classes added in the admin menu, 'current-menu-item', and 'menu-item.' It's basically a modified version of the built-in Walker.
<?php
// Custom walker for nav menus, I personally don't like having a million classes added to my html. So all the fluff is cut. You'll still have access to the menu classes added in the admin menu, 'current-menu-item', and 'menu-item'
class ECB_Walker_Nav_Menu extends Walker {
/**
* @see Walker::$tree_type
* @since 3.0.0
* @var string
*/
var $tree_type = array( 'post_type', 'taxonomy', 'custom' );
@ebinion
ebinion / gist:5690817
Last active March 3, 2016 17:23
Update Postgres "template1"
UPDATE pg_database SET datallowconn = TRUE where datname = 'template0';
\c template0
UPDATE pg_database SET datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UNICODE' LC_CTYPE = 'en_US.UTF-8' LC_COLLATE = 'C';
UPDATE pg_database SET datistemplate = TRUE where datname = 'template1';
\c template1
UPDATE pg_database SET datallowconn = FALSE where datname = 'template0';
@ebinion
ebinion / Vagrantfile
Created July 15, 2013 03:22
Configuration file for Vagrant virtual machine.
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo 'export LC_ALL=en_US.UTF-8' >> /etc/bash.bashrc
echo 'export LANG=en_US.UTF-8' >> /etc/bash.bashrc
echo 'export LANGUAGE=en_US.UTF-8' >> /etc/bash.bashrc
echo 'export RAILS_ENV=production' >> /etc/bash.bashrc
SCRIPT
@ebinion
ebinion / Rails Gemfile.rb
Last active January 1, 2016 06:09
A Gemfile that I use for Rails 4 projects deployed on Heroku.
source 'https://rubygems.org'
ruby "2.0.0"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
@ebinion
ebinion / Responsive Viewport Meta Tag.html
Last active January 1, 2016 06:59
Because I always end up searching for it.
<meta name="viewport" content="width=device-width, initial-scale=1">
@ebinion
ebinion / Vertical Grid Overlay.coffee
Last active January 1, 2016 07:09
Someday I'll turn this into a Chrome Extension ... just not today
window.GridOverlay = (vHeight = 18, canvasId = "gridOverlayCanvas")->
window.console.log("working")
new_canvas = document.createElement("canvas")
new_context = new_canvas.getContext("2d")
new_canvas.id = canvasId
this.setCanvasDimensions = ->
new_canvas.width = document.body.offsetWidth
new_canvas.height = document.body.offsetHeight
@ebinion
ebinion / HTML Ipsum.haml
Created December 24, 2013 10:29
Haml HTML ipsum.
%h1 HTML Ipsum Presents
%h2 Test text, this will likely wrap a few lines to ensure we can test the line height
%h3 Test text, this will likely wrap a few lines to ensure we can test the line height
%h4 Test text, this will likely wrap a few lines to ensure we can test the line height
%h5 Test text, this will likely wrap a few lines to ensure we can test the line height
%h6 Test text, this will likely wrap a few lines to ensure we can test the line height
%p <strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim a
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia