Skip to content

Instantly share code, notes, and snippets.

@albrow
albrow / Rakefile
Last active March 20, 2025 09:04
An excerpt from the Rakefile I use to deploy my blog. http://blog.alexbrowne.info
# ...
desc "Deploy website to s3/cloudfront via aws-sdk"
task :s3_cloudfront => [:generate, :minify, :gzip, :compress_images] do
puts "=================================================="
puts " Deploying to Amazon S3 & CloudFront"
puts "=================================================="
# setup the aws_deploy_tools object
config = YAML::load( File.open("_config.yml"))
@davetron5000
davetron5000 / requirements.md
Created June 22, 2012 15:26
My Ideal Presentation Software

davetron5000's ideal presentation software

  • Editable as text, preferably markdown
  • Plays in a browser
  • Deployable to heroku or other service completely statically
  • clean default look that is easy to customize without slogging through generated HTML
  • hard-fix the dimensions, e.g. 1024x768 for projectors
  • support for remote control for advancing

Slide Types

#!/usr/bin/ruby
require 'time'
def format_time(seconds)
hours = (seconds / 3600).to_i
minutes = ((seconds % 3600) / 60).to_i
seconds = (seconds % 60).to_i
minutes = "0#{minutes}" if minutes < 10
seconds = "0#{seconds}" if seconds < 10
@coreyhaines
coreyhaines / .rspec
Last active August 15, 2024 15:13
Active Record Spec Helper - Loading just active record
--colour
-I app

Running exactly two test files

With just ruby:

$ ruby -Ilib:test -e'require "test1"; require "test2"'

Via your rake task:

$ rake TEST=test/test[1,2].rb
package ca.jbrains.pos.test;
import org.junit.*;
import static org.junit.Assert.*;
import java.util.*;
public class SellOneItemTest {
private POSDisplay display = new POSDisplay();
private Sale sale;
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")