View angular-filters.js
app.filter('capitalize', function() {
return function(input, scope){
if ( input ) {
input = input.toLowerCase();
return input.substring(0,1).toUpperCase() + input.substring(1);
}
};
});
View angular-filters.js
app.filter('capitalize', function() {
return function(input, scope) {
if (input!=null)
input = input.toLowerCase();
return input.substring(0,1).toUpperCase()+input.substring(1);
}
});
View DriveUpload.js
function uploadXls(file) {
authorize();
var key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // <-- developer key
var metadata = { title: file.getName() }
var params = {method:"post",
oAuthServiceName: "drive",
oAuthUseToken: "always",
contentType: "application/vnd.ms-excel",
contentLength: file.getBytes().length,
payload: file.getBytes()
View itunes
#!/bin/bash
#
####################################
# iTunes Command Line Control v1.0
# written by David Schlosnagle
# created 2001.11.08
# TODO add -v for echo message
####################################
showHelp () {
View gist:3521476
" http://vim.wikia.com/wiki/HTML_entities
" http://www.bigbaer.com/sidebars/entities/
" FIXME: you don't know how to use the -range argument! (doesn't work)
command! -range HtmlEncode <line1>,<line2>call HtmlEntities('encode')
command! -range HtmlDecode <line1>,<line2>call HtmlEntities('decode')
" TODO: only accept full lines as a range; would be nice for arbitrary selection
function! HtmlEntities(action) range
" & -> &amp; should be the first substitution
let entities = [
View gist:973821
# mongo_template.rb
#
# mongo_template
#
# Usage:
# rails new appname -m /path/to/mongo_template.rb
#
# Also see http://textmate.rubyforge.org/thor/Thor/Actions.html
#
View gist:972466
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"