Skip to content

Instantly share code, notes, and snippets.

View jxpx777's full-sized avatar
🤠

Jamie Phelps jxpx777

🤠
View GitHub Profile
@jxpx777
jxpx777 / ag_constants.yml
Created January 31, 2011 15:33
Initializer file that loads a YML file for config information for the current environment.
production:
site_url: http://mywebsite.com
ssl_site_url: https://mywebsite.com
licenses_folder: /path/to/shared/licenses
ferret_index_path: /path/to/shared/ferret/index
test:
development:
@jxpx777
jxpx777 / Crash message
Created January 26, 2011 23:01
User model
(ActionView::Template::Error) "invalid byte sequence in UTF-8"
-------------------------------
Backtrace:
-------------------------------
activesupport (3.0.3) lib/active_support/core_ext/object/blank.rb:68:in `=~'
activesupport (3.0.3) lib/active_support/core_ext/object/blank.rb:68:in `!~'
activesupport (3.0.3) lib/active_support/core_ext/object/blank.rb:68:in `blank?'
app/models/user.rb:57:in `city_and_state'
@jxpx777
jxpx777 / post-checkout
Created December 30, 2010 14:09
Currently broken approach to post-checkout sourcing of .rvmrc
#!/usr/bin/ruby
system("source ./.rvmrc") if ARGV[2] == "1"
setup
open '/new_store'
assert_title 'Agile Online Store'
click_and_wait "css=li#product-100 a[href=/new_store/add_to_cart/100?license=SINGLE]"
assert_element_present "css=h3:contains(Summary)"
assert_text "css=td.order-total", "$39.95 USD"
assert_element_present "link=Enter coupon code"
assert_text_present "Buy multiple applications and save!"
assert_text "css=a[href=/new_store/checkout]", "Check Out Now"
click_and_wait "link=Check Out Now"
# A better mmr alias for opening only the relevant files from a directory that's assumed to be a rails project.
alias mmr="ruby -e 'puts %x{ls -A}.split(\"\n\").reject {|el| el =~ /^\./ || el =~ /(tmp|log|esproj)$/}' | xargs mate"
jQuery(document).ready(function(){
eCSStender.addMethod('findBySelector',jQuery);
});
<script type="text/javascript">
// <![CDATA[
eCSStender.disableCache();
eCSStender.addMethod('findBySelector',Sizzle);
function testSupport( selector )
{
try {
eCSStender.methods.findBySelector(selector);
}
catch( e )
//
// NSMetadataItem+JPIKImageBrowserItem.m
// Created by Jamie Phelps on 10/20/09.
//
// Licensed under the Don't Be A Dick License
//
@interface NSMetadataItem (JPIKImageBrowserItem)
-(NSString *)imageUID;
-(NSString *)imageRepresentationType;
//
// NSMetadataItem+JPQLPreviewItem.m
// Created by Jamie Phelps on 2/6/10.
//
// Licensed under the Don't Be A Dick License
//
@interface NSMetadataItem (JPQLPreviewItem)
-(NSString *)previewItemTitle;
-(NSURL *)previewItemURL;