Author Archives: Curtis Jennings Schofield

Getting Started in LaTeX

Jump Straight to Code Examples Note: This post is not a substitute for reading: The Not So Short Introduction to LaTeX2epsilon. What is LaTex or Tex? TeX was developed in 1977 by Donald Knuth. LaTeX was written on-top of TeX to give a few pre-defined layouts to ease the process of using the typesetting tool [...]

Making a javascript asset rails gem with jeweler.

Step one) Use the Jeweler gem. Seriously this is a brilliant piece of work. It allows you to concentrate on building your gem. Step two) Create a file for bundler to load

I am using ‘_’ as a convention for filenames as ClassName to class_name has been a convention in the rails community and the [...]

Building Small Web Services with a Heroku and Unicorn Sinatra Template Project

Using Sinatra Unicorn and Heroku (CEDAR stack) Together! I have been asked “How do I get started with Unicorn and Heroku?” “How can I made a remote HTTP webhook?” “How can I make a simple web service?” , “How can I get started with a free ruby hosting evironment?” I want to take a moment [...]

REPL Mocks in Rspec 2.9

REPL (Read-Eval-Print-Loop) is a great way to learn. Sarah Allen has a great post on REPL and rspec. Sarah’s Post on REPL Rspec In Rspec 2.9 there is a nice way to get the standalone way working $ irb 1.9.2p290 :001 > require ‘rspec/mocks/standalone’ 1.9.2p290 :002 > Time.stub(:now) {1} 1.9.2p290 :003 > => 1

Installing RSpec and Sinatra with Rake

Installing Rspec into Sinatra with Rake This will give you a friendly ‘rails-like’ interface to running your automation tests. Sinatra doesn’t come with any test harness by default and so you’ll find yourself needing to integrate something. As a bonus I include a way to gain access to an instance of your sinatra module while [...]

Responsive Web Device Design Helper

In the head of my responsive web site I use the following meta tag <meta name="viewport" content="width=device-width,initial-scale=1.0"> Then in a head script element //<![CDATA[ document.writeln("<div class='debug'> w("+ screen.width /16 +")-screen-h("+ screen.height /16 +") -- w("+ window.innerWidth /16 +")-inner-window-h("+ window.innerHeight /16 +")</div>") //]]> Also in the head I have the following style sheets <link rel="stylesheet" href="assets/responsive/base.css"> [...]

many heroku apps? try -remote

I love how I can use the ‘-remote’ flag with heroku gem to tell heroku to use the application that is refereed to by my git remote name ‘production’ This way i don’t have to remember the name of the app all the time for every project and i can easily work with heroku the [...]

Amazon SES in 20 minutes

1) Sign into AWS account 2) Get your Account Security key, and secret key 3) add to bundle : gem ‘aws-ses’, :require => ‘aws/ses’ 4) you are going to need to know that you are sandboxed - this means you can only send to - and send from emails that you verify. here is a [...]

‘rt’ - Replace Text in Ruby for Rails 3 Upgrade, Charlie Brown

If you would like to use the actual file that we used to transform the code from RSpec 1 to 2, Webrat to Capybara and a few things around Rails 2 to rails 3. You can find this file in the repository