Skip to content

Instantly share code, notes, and snippets.

View nchapman's full-sized avatar

Nick Chapman nchapman

View GitHub Profile
header.main .hook, .container, footer.main
{
width: 87em;
margin: 0 auto;
}
/* Fluid
header.main .hook, .container, footer.main
{
width: auto;
# iWeb at root of domain on MediaTemple (gs)
DirectoryIndex Welcome.html
RewriteEngine on
RewriteCond %{REQUEST_URI} !/MySite/
RewriteRule ^(.*?)$ /MySite/$1 [L]
<!DOCTYPE html>
<html>
<head>
<title>HTML5</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=650, user-scalable=yes">
<!-- pick your poison:
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
-->
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Boilerplate</title>
<meta charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"></script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="screen.css" />
# ruby font_sizes_from_base.rb 13
(10..50).each { |i| puts "#{i}px => #{(i/ARGV[0].to_f * 100).round}%" }
// To get delimited values as an array
if (!string.IsNullOrEmpty(input))
items = input.Split(new[] { ",", " ", ";" }, StringSplitOptions.RemoveEmptyEntries);
// To put them back together with a standard delimiter
var output = string.Join(", ", items);
require 'rubygems'
require 'fastercsv'
def normalize(row)
row[2].sub!(/^0+/, "")
row[3].sub!(/^0+/, "")
return row
end
old_rows = FasterCSV.read "old.csv"
SELECT HOUR(CONVERT_TZ(created_at, '+00:00','-07:00')) AS hour, COUNT(DISTINCT uuid) as count FROM hits WHERE DATE(created_at) = DATE(NOW()) GROUP BY HOUR(created_at);
require 'erubis'
class Verb
def call(env)
base_path = File.join(Dir.pwd, env["REQUEST_URI"].sub(/\/$/, ""))
exact_path = base_path + ".rhtml"
index_path = File.join(base_path, "index.rhtml")
if File.exists?(exact_path)
render(exact_path, env)
protected override void DataPortal_Update()
{
RaiseListChangedEvents = false;
using (SqlConnection cn = new SqlConnection(Database.LocalConnection))
{
cn.Open();
// loop through each deleted child object
// foreach (Sales deletedChild in DeletedList)
// // deletedChild.DeleteSelf(cn);
// DeletedList.Clear();