Skip to content

Instantly share code, notes, and snippets.

@rwbaker
rwbaker / rwbaker.vcf
Created January 12, 2018 19:49
Business Card
BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//Mac OS X 10.12.6//EN
N:Baker;Richard;;;
FN:Richard Baker
ORG:GETransportation;
TITLE:Director of User Experience
EMAIL;type=INTERNET;type=HOME;type=pref:[email protected]
EMAIL;type=INTERNET;type=WORK:[email protected]
item1.URL;type=pref:http://www.rwbaker.com
@rwbaker
rwbaker / Copyright Year
Created January 7, 2013 19:17
Set the copyright year to the current year, if the current year is greater.
@rwbaker
rwbaker / Preferences.sublime-settings
Created August 22, 2012 12:02
Sublime Text 2 Preferences
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Monokai Soda.tmTheme",
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".sass-cache"
@rwbaker
rwbaker / unixtime.js
Created May 22, 2012 13:45
JavaScript: Unix time stamp converter
var myDate = 1337678451;
var date = new Date(myDate*1000);
var hrs = date.getHours();
var min = date.getMinutes();
var sec = date.getSeconds();
var day = date.getDate();
var month = date.getMonth();
var year = date.getFullYear();
console.log(month + '/' + day + '/' + year +' @ ' + hrs + ':' + min + ':' + sec);
@rwbaker
rwbaker / Importing posts from Wordpress into Jekyll.rb
Created November 15, 2011 17:42 — forked from vitobotta/Importing posts from Wordpress into Jekyll.rb
The script I used to import posts from my Wordpress blog into a new Jekyll one.
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g}
require File.join(File.dirname(__FILE__), "downmark_it")
module WordPress
def self.import(database, user, password, table_prefix = "wp", host = 'localhost')
db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8')
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder}
@rwbaker
rwbaker / default.css
Created October 17, 2011 01:46
CSS: Basic CSS starter
/* Default Styles
-------------------------------------------------------------------------------------*/
body {margin:0; font:14px/1.4 Arial, Tahoma, sans-serif; background:#fff; color:#333;}
/* Generics */
.hide {display:none;}
.left {float:left;}
.right {float:right;}
/* Text Styles */
@rwbaker
rwbaker / forms.css
Created October 17, 2011 01:40
CSS: HTML Form Layout Style
/*
Author: Richard Baker; rwbaker.com
*/
/* Markup example:
<fieldset>
<legend>Form</legend>
<ul class="vert">
<li>
<label>Field label text</label>
@rwbaker
rwbaker / todaysDate.js
Created October 17, 2011 01:37
JavaScript: Get today's date
//Set the date
var today = new Date;
today.day = today.getDayName();
today.month = today.getMonthName();
today.date = today.getDay();
today.year = getFullYear();
//Extend Date to have a few extra fatures
Date.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
@rwbaker
rwbaker / dateExtend.js
Created October 17, 2011 01:36
JavaScript: Extend Date
//Extend Date to have a few extra fatures
Date.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
Date.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
Date.prototype.dayNames = Date.dayNames;
Date.prototype.monthNames = Date.monthNames;
Date.prototype.getDayName = function() {
return this.dayNames[this.getDay()];
};
Date.prototype.getDayNameAbbr = function() {
@rwbaker
rwbaker / jquerybase.js
Created October 17, 2011 01:35
JavaScript: jQuery Plugin Bootstrap
$(document).ready(function() {
app.loadPlugins()
//Initialize for all pages
app.init.main()
})
var app = {