Skip to content

Instantly share code, notes, and snippets.

View renaehodgkins's full-sized avatar

Renae Hodgkins renaehodgkins

View GitHub Profile
@renaehodgkins
renaehodgkins / test
Created November 17, 2011 17:14
test
renaebair@siren ~/workspace/intridea/passport (master)
→ rails server
/Users/renaebair/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require': no such file to load -- RMagick2.so (LoadError)
from /Users/renaebair/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /Users/renaebair/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /Users/renaebair/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/renaebair/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/renaebair/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /Users/renaebair/.rvm/gems/ruby-1.9.2-p180/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `<top (required)>'
f
@renaehodgkins
renaehodgkins / blogs_helper.rb
Created January 10, 2012 19:44
_top_footer.html.erb
def post_link(post, blog = nil, html_options = {})
method = (html_options.delete(:url) == true ? "url" : "path")
# send "blog_post_#{method}", post.published_on.year, post.published_on.month, post.published_on.day, post.slug
blog_post_path(post.published_on.year, post.published_on.month, post.published_on.day, post.slug)
end
Betterfly connects talented individuals directly with people who want their skills. Their community is comprised of people who believe in the power of "better" and are redefining the ways in which people better themselves.
Betterfly came to us for direction on updating their existing design to further engage and serve the members of their community. Our Design team helped them rethink everything about their site from content and layout to strategies for products and custom profiles. We designed a fresh user interface, an intuitive layout, and bright, modern visuals.
@renaehodgkins
renaehodgkins / gist:1601509
Created January 12, 2012 16:40
suuuuckkkk
renaebair@siren ~/workspace/intridea/newsite (railsupgrade)
→ heroku logs --tail --app intridea-stg
2012-01-12T16:37:13+00:00 app[web.1]: => Rails 3.1.0 application starting in production on http://0.0.0.0:29146
2012-01-12T16:37:13+00:00 app[web.1]: => Booting WEBrick
2012-01-12T16:37:13+00:00 app[web.1]: => Call with -d to detach
2012-01-12T16:37:13+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-01-12T16:37:13+00:00 app[web.1]:
2012-01-12T16:37:13+00:00 app[web.1]:
2012-01-12T16:37:13+00:00 app[web.1]: Started GET "/" for 72.44.60.192 at 2012-01-12 11:37:13 -0500
2012-01-12T16:37:14+00:00 app[web.1]: ** [Airbrake] Success: Net::HTTPOK
@renaehodgkins
renaehodgkins / gist:1602614
Created January 12, 2012 19:40
intrdea-stg
renaebair@siren ~/workspace/intridea/newsite (railsupgrade)
→ git push intridea-stg railsupgrade:master
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 354 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
-----> Heroku receiving push
-----> Removing .DS_Store files

Unit tests should pass when run in random order. But for an existing legacy project certain tests might depend on the execution order. One test might run perfectly fine by itself, but fail miserably when run after another test. Rather than running different combinations manually, RSpec 2.8 has the option to run specs in random order with the --order random flag. But even with this it can be hard to determine which specific test is causing the dependency. For example:

rspec spec/controllers  # succeeds

rspec spec/lib/my_lib_spec.rb # succeeds

Unit tests should pass when run in random order. But for an existing legacy
project certain tests might depend on the execution order. One test might run
perfectly fine by itself, but fail miserably when run *after* another test.
Rather than running different combinations manually, RSpec 2.8 has the option
to run specs in random order with the `--order random` flag. But even with
this it can be hard to determine which specific test is causing the
dependency. For example:
rspec spec/controllers # succeeds
rspec spec/lib/my_lib_spec.rb # succeeds

The html code snippet below is being stylized just with ````html (github flavored markdown allows to define a code snippet with four back ticks). Even though redcarpet renders the following correctly, coderay isn't adding style to it as html in my application.

<html>
  <head></head>
  <body>
    <div id='header'>
      <a href='#'>Rocky Road Blog</a>
    </div>
 
@renaehodgkins
renaehodgkins / contact form
Created January 24, 2012 20:11
contact_form
jQuery(document).ready(function() {
validate_contact_form('#contact_form');
});
function validate_contact_form(form){
var validation_fields = ["#first_name", "#last_name", "#company", "#phone"];
jQuery.each(validation_fields, function(index, value){
$(form + ' ' + value).blur(function(){
validate_presence_of(this, form);
/* ----- Font Information -----
@font-face
font-family: "MuseoSans900"
src: url("/assets/museosans_900-webfont.eot")
src: local("☺"), url("/assets/museosans_900-webfont.woff") format("woff"), url("/assets/museosans_900-webfont.ttf") format("truetype"), url("/assets/museosans_900-webfont.svg#webfontl7P4kdU8") format("svg")
@font-face
font-family: "MuseoSans100"