View sftp.thor.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
View graphic-novelist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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 |
View gist:306785
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to: http://github.com/gf3/dotfiles/blob/master/bash_prompt |
View get_barcode_from_image.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
View gist:439777
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Provides a device_scale class on iOS devices for scaling user | |
// interface elements relative to the current zoom factor. | |
// | |
// http://37signals.com/svn/posts/2407-device-scale-user-interface-elements-in-ios-mobile-safari | |
// Copyright (c) 2010 37signals. | |
// | |
// 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 |
View Rakefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake/clean' | |
HAML = FileList['**/*.haml'] | |
LESS = FileList['**/*.less'] | |
COFFEE = FileList['**/*.coffee'] | |
HTML = HAML.ext('html') | |
CSS = LESS.ext('css') | |
JS = COFFEE.ext('js') |
View documents.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Document Model | |
dc.model.Document = Backbone.Model.extend({ | |
constructor : function(attrs, options) { | |
attrs.selected = false; | |
attrs.selectable = true; | |
if (attrs.annotation_count == null) attrs.annotation_count = 0; | |
Backbone.Model.call(this, attrs, options); | |
var id = this.id; |
View makeapp.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
read inputline | |
name="$inputline" | |
echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
read inputline | |
url="$inputline" |
View Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Patterns matching CSS files that should be minified. Files with a -min.css | |
# suffix will be ignored. | |
CSS_FILES = $(filter-out %-min.css,$(wildcard \ | |
public/css/*.css \ | |
public/css/**/*.css \ | |
)) | |
# Patterns matching JS files that should be minified. Files with a -min.js | |
# suffix will be ignored. | |
JS_FILES = $(filter-out %-min.js,$(wildcard \ |
View duration.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Transform an integer number of seconds as hours and minutes: 1:45 | |
# | |
# Put in filters/duration.coffee and do @require('filters', 'duration') | |
Batman.Filters.formatSecondsAsTime = (value) -> | |
seconds = parseInt value, 10 | |
return '' unless seconds | |
hours = parseInt seconds / 60 / 60, 10 | |
minutes = parseInt (seconds / 60) % 60, 10 | |
hours = '' unless hours > 0 | |
minutes = '0' + minutes if minutes < 10 |
OlderNewer