Skip to content

Instantly share code, notes, and snippets.

@robotarmy
robotarmy / codelistinghelper.tex
Created July 25, 2012 18:42
How to layout code listings with a caption and a frame around the code
\usepackage{color}
\usepackage{xcolor}
\usepackage{calc}
\newlength\captionLeftDimension
\newlength\captionRightDimension
\setlength\captionLeftDimension{ \fboxsep+(\fboxrule*3)}
\setlength\captionRightDimension{-\fboxsep+(\fboxrule*3)}
\usepackage{listings}
\lstset{frame=single,
@robotarmy
robotarmy / quotes
Created July 25, 2012 18:55
What are quotes in tex
``It was a dark and stormy night'', she began -- her tone hushed and deep.
The huddled children who sat around their campfire exclaimed together: ``GROAN!''
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<link rel="stylesheet" href="my.css" />
<style>
/* App custom styles */
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
</script>
source 'http://rubygems.org'
gem 'rails', '3.0.7'
gem 'sqlite3'
group :development, :test do
gem 'rspec-rails'
end
o_o:suggestotron/ $ rake cucumber FEATURE=features/1_topics.feature [7:23:30]
(in /Users/o_o/Class/Railsbridge-Q2/rubyonrails/suggestotron)
bundle exec /Users/o_o/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -I "/Users/o_o/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib:lib" "/Users/o_o/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/bin/cucumber" --profile default features/1_topics.feature
Using the default profile...
Feature: Topics
In order to see a list of potential topics for meetings
people need to be able to create and edit them
Scenario: Getting to the new topic page # features/1_topics.feature:5
When I go to the topics page # features/step_definitions/web_steps.rb:48
diff --git a/support/env.rb b/support/env.rb
index bf06218..cc63886 100644
--- a/support/env.rb
+++ b/support/env.rb
@@ -4,56 +4,36 @@
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
-ENV["RAILS_ENV"] ||= "test"
-require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
@robotarmy
robotarmy / FrequencyCount.st
Created April 14, 2011 17:55
splitOn: creates an ordered Collection from a ' ' object (Text? String? SomethingEls?)
Transcript clear.
dc := Dictionary new.
b := ' t aoeu a aoeu aou aoeu' splitOn: ' '.
b do: [:e |
dc at:e ifAbsentPut: [ 0 ].
dc at:e put: ((dc at: e) + 1).
].
Transcript show: dc.
require 'spec_helper'
describe FeedbackController do
describe "actions" do
it "#create" do
questions = ['what do you like most?','what is your favorite colour?'],
answers = ['I like life!', 'I like green'],
comment = %%Blue is also nice, Red is the colour of blood, tomatoes,
and sunsets over the ocean when the light is just right%,
page_url = %%http://url%
@robotarmy
robotarmy / javascript-instance-based-inheritance-v8console.txt
Created March 14, 2011 18:23
javascript-instance-based-inheritance-v8console.js
> a = function() {}
function () {}
> print(a)
function () {}
> b = function(){}
function (){}
> b.prototype = a
function () {}
> a.my_hi = function() { print('my_hi') }
function () { print('my_hi') }
@robotarmy
robotarmy / main.s
Created February 28, 2011 00:52
..
.arm
.align
.global initSystem
.global main
.mdata:
@ 4bytes *8
.word 0x4430
.word 0x4430
.word 0x4430