Skip to content

Instantly share code, notes, and snippets.

View mattmccray's full-sized avatar

Matt McCray mattmccray

View GitHub Profile
require 'find'
require 'rubygems'
require 'digest/md5'
gem 'net-sftp', '<2.0.0'
require 'net/sftp'
class SftpDirPublisher
CHECKSUM_FILENAME = ".checksums"
attr_reader :host, :username, :password, :remote_dir, :local_dir, :exclude
@mattmccray
mattmccray / sftp.thor.rb
Created July 26, 2008 00:04
Thor task for sftp syncing
# module: sftp
# A generic Thor module for sftp syncing.
#
# 1. Call `thor sftp:setup` to create config file.
# 2. Edit the config file
# 3. Call `tor sftp:sync` start the sync
#
# Ze end.
//
// Graphic Novelist (graphic-novelist.js)
// Created by M@ McCray
// site: http://mattmccray.com
// email: matt at elucidata dot net
//
// API:
//
// GraphicNovelist.parse( text ) -> Parse text into array of script Nodes
// GraphicNovelist.renderNodes( nodes ) -> Renders array of script Nodes into HTML
/*
Scrippets:
Blocks of text formatted as a screenplay
Original Ruby script by John August:
site: http://johnaugust.com
script: http://pastie.org/257717
css: http://pastie.org/257678
JavaScript version by M@ McCray:
// PROJECT MOVED TO: http://github.com/darthapo/liquid.js
/* Copyright (c) 2005, 2006 Tobias Luetke,
JavaScript port by M@ McCray (http://www.mattmccray.com)
Requires Mootools 1.2
http://github.com/darthapo/liquid.js/wikis
@mattmccray
mattmccray / relative_paths.rb
Created September 11, 2008 21:36
A webby filter for turning absolute paths (paths that start with a slash "/") into relative paths ("../").
# A webby filter for turning absolute paths (paths that start with a slash "/")
# into relative paths ("../").
#
# Should be used as a filter for Layouts.
#
# Created by: M@ McCray (http://mattmccray.com)
require 'hpricot'
#!/usr/bin/env ruby
#
# file_organizer.rb
# (http://gist.github.com/16180)
#
# By M@ McCray -- www.mattmccray.com (matt at elucidata dot net)
#
# Usage:
#
# organize_files_within( target_folder )
desc "Compiles haml files (and hamlets) - v1.2"
task :hamlet do
# by M@
require 'rubygems'
require 'haml'
require 'fileutils'
main_files = []
@@src_path = File.expand_path( ENV.fetch('SRC', './') )
@@out_path = File.expand_path( ENV.fetch('OUT', './') )
# For use with red: http://github.com/backtik/red/tree/master
require 'redshift'
#
# Usage:
#
# // The following are all comparable
# Styles.selectors['.task-entry'].properties[:width] = '300px'
# Styles['.task-entry'].properties[:width] = '300px'
# Styles['.task-entry'][:width] = '300px'
@mattmccray
mattmccray / _grid.sass
Created July 17, 2009 19:22
Simple, SASS based, grid system
!columns ||= 12
!column_width ||= 60
!column_margin ||= 20
.row
overflow: hidden
margin: 0 auto
width: #{!columns * !column_width + !columns * !column_margin}px
.row