Skip to content

Instantly share code, notes, and snippets.

View tcmacdonald's full-sized avatar
🪕

Taylor MacDonald tcmacdonald

🪕
  • Ample
  • Cincinnati, OH
View GitHub Profile
@tcmacdonald
tcmacdonald / jsbin.ikowub.css
Created August 7, 2013 14:17
Responsive SVG Charts
.chart{
width: 100%;
height: 100px;
overflow: hidden;
}
.chart_icon{
position: absolute;
font-size: 25px;
right: 5px;
# Adapted from Frank:
# https://github.com/blahed/frank/
# Copyright (c) 2010 Travis Dunn
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
if has("gui_macvim")
macmenu &File.New\ Tab key=<nop>
map <D-t> :CommandT<CR>
endif
@tcmacdonald
tcmacdonald / front_matter.rb
Created October 30, 2012 14:54
Pulling front matter from Rails views template.
require 'active_support/concern'
module FrontMatter
extend ActiveSupport::Concern
included do
helper_method :front_matter
end
def front_matter
@tcmacdonald
tcmacdonald / postgresql.rake
Created October 22, 2012 15:27
Rake tasks for Postgresql
require 'yaml'
namespace :pg do
namespace :mac do
def conf
@conf ||= YAML.load_file("#{Rails.root}/config/database.yml")
end
def username
@tcmacdonald
tcmacdonald / .vimrc
Last active October 6, 2015 00:08
.vimrc
set nocompatible " be iMproved
filetype off " required!
call pathogen#infect()
if has("gui_macvim")
" let Vundle manage Vundle
" set rtp+=~/.vim/bundle/vundle/
" call vundle#rc()
" Bundle 'gmarik/vundle'
@tcmacdonald
tcmacdonald / gist:2900977
Created June 9, 2012 13:30
VIM: Repeat Edit Commands
.. # last edit (magic dot)
:& # last substitute
:%& # last substitute every line
:%&gic # last substitute every line confirm
g% # normal mode repeat last substitute
g& # last substitute on all lines
@@ # last recording
@: # last command-mode command
:!! # last :! command
:~ # last substitute
@tcmacdonald
tcmacdonald / index.html
Created April 4, 2012 13:56
Paycor OH Implementation Details
<!-- To be included directly before closing body tag -->
<script>
$(document).ready(function(){
var client_ids = $('select#ctl00_ctl00_placeHolderMain_cphMainContent_cbClient option').map(function() {
return /\d+/.exec($(this).val());
}).get().join(',')
var sp = document.createElement('script');
sp.type = 'text/javascript';
sp.src = "//www.paycor.com/syndicated/online-home.js?client_ids=" + client_ids;
@tcmacdonald
tcmacdonald / application.js
Created March 12, 2012 15:47
Textile WYSIWYG Editor
$.each($('textarea.textile'),function(i,el){
TextileEditor.initialize($(el).attr('id'));
});
@tcmacdonald
tcmacdonald / firefox.js.coffee
Created January 9, 2012 20:16
Native Detection for FF Pre 3.5
if /Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)
ffversion = new Number(RegExp.$1)
if ffversion < 3.5
head = document.getElementsByTagName("head")[0]
el = document.createElement("link")
el.type = "text/css"
el.rel = "stylesheet"
el.href = "/assets/firefox.css"
el.media = "screen"
head.appendChild el