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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'rubygems' | |
require "mp3info" | |
dir = File.expand_path(File.dirname(__FILE__)) | |
Dir["#{dir}/*mp3"].each do |filename| | |
Mp3Info.open(filename) do |mp3| | |
disk_num = mp3.tag2["disc_number"] |
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
CoffeeScript | |
ColdFusion | |
Cucumber | |
HTML-CSS-JS Prettify | |
Javascript Beautify | |
JSONLint | |
Package Control | |
PowerShell | |
Pretty JSON | |
RocketUniData |
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
// visit a the pictures uploaded from cell phone page | |
// instant upload images are here: https://plus.google.com/u/0/photos/fromphone | |
// open javascript console... | |
// add jQuery to page | |
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1; g.src="//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"; s.parentNode.insertBefore(g,s)}(document,"script")); | |
// create an array of objects, where the `url` property is the full size original uploaded image | |
var a=[];jQuery.each(jQuery("img.B-J-pc-ja[src$='.jpg'],img.B-J-pc-ja[src$='.JPG']"), function(i,item){var h={src:jQuery(this).attr('src')};h.proto=h.src.split('://')[0];h.host=h.src.split('://')[1].split('/')[0];h.pieces=h.src.split('://')[1].split('/');var url=[];for(var i=1;i<h.pieces.length;i++){if(i==(h.pieces.length-2)){url.push('s0-d');}else{url.push(h.pieces[i]);}};h.url=h.proto+'://'+h.host+'/'+url.join('/');a.push(h); });a; |
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
class SomeMailerTest < ActionMailer::TestCase | |
# include this so that assert_template is defined | |
include ActionController::TemplateAssertions | |
end | |
class SomeMailerTest < ActionMailer::TestCase | |
test "the mailer" do | |
email = SomeMailer.the_mailer.deliver | |
assert_template :partial=>'_the_mailer_partial' | |
end |
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
=begin | |
I am using Ruby to parse exported data generated from Datatel. I ran into a strange problem with conflicting character sets. | |
Datatel's internal character set is: ISO_8859-1 | |
Datatel will set the metadata in the export text file to be: US-ASCII | |
And I want Ruby to use this charset: UTF-8 | |
=end |
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
.ui-hide-label .ui-show-label label { | |
/* show a label nested within a hide label */ | |
position: relative !important; | |
left: auto !important; | |
clip: auto !important; | |
} |
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
@media all and (max-width: 450px){ | |
.ui-field-contain, .ui-mobile fieldset.ui-field-contain { | |
border-width: 0 !important; | |
padding: 0 !important; | |
margin: 1em 0 !important; | |
} | |
} |
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
var default_msg = $.mobile.loadingMessage; // set this outside function scope so we can access it later | |
// you must provide a msg argument. The delay and theme arguments are optional. | |
function show_hide_message = function(msg,delay,theme) { | |
if (typeof(delay)==='undefined') { | |
var delay = 3500; // in milliseconds | |
} | |
if (typeof(theme)==='undefined') { | |
var theme = 'a'; // default theme; setting this to 'e' is nice for error messages | |
} |
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
// run this after pageload/DOM ready | |
// this will modify HTML generated by Ruby on Rails :error_messages_for helper method | |
function jqmify_error_messages_for() { | |
var sel = $("div.errorExplanation"); | |
if (sel.length>0) { | |
sel.parent().addClass("ui-body").addClass("ui-body-e"); | |
sel.attr('data-role','collapsible') | |
.attr('data-theme','e') | |
.collapsible() | |
.trigger('expand'); |
OlderNewer