Skip to content

Instantly share code, notes, and snippets.

@janson
janson / _contact.rb
Created August 9, 2011 19:59 — forked from ghickman/_contact.rb
Jekyll Contact Form with Sinatra
require 'rubygems'
require 'sinatra'
require 'pony'
require 'haml'
set :haml, {:format => :html5}
set :public, File.dirname(__FILE__)
set :views, File.dirname(__FILE__)
# Create the page class and give it a title of Contact for the layout
@janson
janson / Contract Killer 3.md
Created November 12, 2012 19:09
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

#Behold, the nav_link:

The nav_link helper works just like the standard Rails link_to helper, but adds a 'selected' class to your link (or its wrapper) if certain criteria are met. By default, if the link's destination url is the same url as the url of the current page, a default class of 'selected' is added to the link.

For full usage details, see: http://viget.com/extend/rails-selected-nav-link-helper

Drop nav_link_helper.rb into app/helpers in your Rails 3.x app and enjoy.

@janson
janson / 0_reuse_code.js
Created October 14, 2015 14:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@janson
janson / db-mysql_connect-test.php
Last active December 6, 2016 15:33 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
# Fill out the four db vars and run on cli
# $ php -f db-mysql_connect-test.php
$dbname = 'db';
$dbuser = 'user';
$dbpass = '';
$dbhost = 'localhost';
## end vars