This file contains hidden or 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
=== Epic Snow Leopard Upgrayyyyd Guide === | |
Son, you’re now living in the land of 64-bit systems. | |
That means that some of your 32-bit shit is now broken. | |
Not all is lost. | |
== Fixing MySQL weirdness |
This file contains hidden or 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 Foo < ActiveRecord::Base | |
named_scope :infix_search, lambda { |string| | |
if string.blank? | |
{} | |
else | |
tokens = string.chars.downcase.split.uniq.first(10) # Avoid too heavy queries. | |
fields = %w[ | |
foo.bar foo.baz | |
oink.boink |
This file contains hidden or 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
# Make Builder default to CDATA and not bork numbers. | |
# By Henrik Nyh <http://henrik.nyh.se> 2009-08-07 under the MIT license. | |
require "rubygems" | |
require "builder" | |
xml_1 = Builder::XmlMarkup.new | |
xml_2 = Builder::XmlMarkup.new | |
# Override Builder so CDATA is used by default to escape text, and with no whitespace |
This file contains hidden or 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
// Make jQuery UI tabs pick the selected tab from the URL hash, | |
// and set the selected tab id as the hash. | |
// | |
// By Henrik Nyh <http://henrik.nyh.se> 2009-09-10 under the MIT License. | |
// Based on code by Mark Yoon: http://articles.rootsmith.ca/mod_python/how-to-make-jquery-ui-tabs-linkable-or-bookmarkable#comment-10188 | |
$('#foo').tabs(); | |
$('.tabs').each(function() { |
This file contains hidden or 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 | |
# | |
# Git commit-msg hook. If your branch name is in the form "t123", automatically | |
# adds "Refs #123." to commit messages unless they mention "#123" already. | |
# Include "#close" or "#finish" to add "Closes #123." | |
# | |
# For Pivotal Tracker, branch names like "s123" adds "[#123]". | |
# Include "#close" or "#finish" to add "[Finishes #123]". | |
# | |
# If you include "#noref" in the commit message, nothing will be added to |
This file contains hidden or 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
diff --git a/public/javascripts/jquery.tablednd_0_5.js b/public/javascripts/jquery.tablednd_0_5.js | |
index d4c9fec..e391a62 100644 | |
--- a/public/javascripts/jquery.tablednd_0_5.js | |
+++ b/public/javascripts/jquery.tablednd_0_5.js | |
@@ -144,7 +144,7 @@ jQuery.tableDnD = { | |
// Iterate through each row, the row is bound to "this" | |
var row = jQuery(this); | |
if (! row.hasClass("nodrag")) { | |
- row.mousedown(function(ev) { | |
+ row.bind('mousedown.tableDnD', function(ev) { |
This file contains hidden or 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 Prawn::Graphics | |
# E.g. stroke_dashed_horizontal_line(0, 5.cm, :at => 10.cm, :line_length => 1.cm, :space_length => 1.mm) | |
# Currently rounds up line/space periods: 1 cm line length + 1 mm space as a 3 cm line would be "- - -", 3.2 cm total. | |
def stroke_dashed_horizontal_line(x1,x2,options={}) | |
options = options.dup | |
line_length = options.delete(:line_length) || 0.5.mm | |
space_length = options.delete(:space_length) || line_length | |
period_length = line_length + space_length | |
total_length = x2 - x1 |
This file contains hidden or 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
# Workaround to get "Page 1 of 2". Based on | |
# http://groups.google.com/group/prawn-ruby/msg/f08f8b0da9db6eb6 | |
class Prawn::Document | |
# Fixed in post-processing so only use as a replacable string. | |
def total_page_count | |
"#PP#" | |
end | |
alias_method :render_without_total_pages, :render |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>beforeRunningCommand</key> | |
<string>nop</string> | |
<key>bundleUUID</key> | |
<string>C9BD1ADE-4FD9-4842-A641-DFB373B7D42C</string> | |
<key>command</key> | |
<string>#!/usr/bin/env ruby |
This file contains hidden or 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
<?xml version="1.0"?> | |
<!-- | |
Edit ~/Library/Application Support/Plex/userdata/advancedsettings.xml | |
See http://xbmc.org/wiki/?title=AdvancedSettings.xml#.3Ctvshowmatching.3E | |
and http://wiki.plexapp.com/index.php/Changing_TV_Show_Naming_Conventions | |
--> | |
<advancedsettings> | |
<tvshowmatching action="append"> | |
<regexp>[\._ \-][Ss]([0-9]+)[\.\-xX]?[Ee]([0-9]+)([^\\/]*)</regexp> <!-- allow S01xE02, e.g. "Deadwood - S01E01 - Deadwood" --> | |
</tvshowmatching> |