Skip to content

Instantly share code, notes, and snippets.

View timkelty's full-sized avatar

Tim Kelty timkelty

View GitHub Profile
# !/bin/bash
# Set up an new github repository
GITHUB_USERNAME="timkelty"
# from github instructions page after creating a repo
mkdir "$1"
cd "$1"
git init
touch README
/*
Sticky Footer Solution
by Steve Hatcher
http://stever.ca
http://www.cssstickyfooter.com
*/
* {margin:0;padding:0;}
/* must declare 0 margins on everything, also for main layout components use padding, not
=times
{
font-family: Times, Times New Roman, Georgia, serif;
}
=helvetica
{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@timkelty
timkelty / Sticky Footer
Created February 11, 2010 13:33
Sticky Footer
asdfasd fasdfads
# Add a trailing slash to paths without an extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [L,R=301]
{exp:structure_entries
parent="/{segment_1}/{segment_2}/"
depth="2"}
{if {depth} == 1}
{if {count} == 1}<ul class="nav-side">{/if}
<li class="entry-{entry_id}{if {current_page}} active{/if}{if {current_parent}} parent-active{/if}{if {count} == 1 && embed:first_class != "no"} first{/if}{if {last_child} == 1 && embed:last_class != "no"} last{/if}">
<a href="{page_uri}" rel="{if cf_pages_redirects_new}window{/if} {if cf_pages_redirect_warning}warning{/if}">{hidden_snippets_title}</a>
{if {children_total} == 0}{!-- No Children - so close markup --}
</li>
{/if}
<?php
// import a pipe delimited list of entry ids into your custom field
// this is the column name of your Playa field
$ee_column = 'field_id_160';
global $DB;
$rels = array();
$entries_query = $DB->query("SELECT entry_id, $ee_column FROM exp_weblog_data WHERE $ee_column");
$entries = $entries_query->result;
// import a pipe delimited list of entry ids into your custom field
// this is the column name of your Playa field
$ee_column = 'field_id_160';
global $DB;
$rels = array();
$entries_query = $DB->query("SELECT entry_id, $ee_column FROM exp_weblog_data WHERE $ee_column");
$entries = $entries_query->result;
load_files
url = URI.parse('http://gist.github.com/api/v1/xml/new')
req = Net::HTTP.post_form(url, data(private_gist))
case req
when Net::HTTPBadRequest
print "Ewww, not your fault, but something bad happened. No gist created."
when Net::HTTPFound
url = copy req['Location']
print "Created gist at #{url}