Skip to content

Instantly share code, notes, and snippets.

View rmw's full-sized avatar

Rebecca Miller-Webster rmw

View GitHub Profile
<% iterations.each do |iteration| %>
<h2 id='Sprint_<%= iteration.number %>' style='display:inline'>Sprint <%= iteration.number %></h2><i> - ends <%= iteration.finish.strftime("%Y-%m-%d") %></i><a href='#Sprint_<%= iteration.number %>' class='anchor'>&nbsp;&para;</a>
<ul>
<% iteration.stories.each do |story| %>
<li class='story'><h3 style='display:inline'><i>Story <%= story.id %> (<%= story.current_state %>)</i></h3>
<small class='taskCount'><i><%= " - #{story.tasks.size} tasks defined" if story.respond_to?(:tasks) %></i></small>
<p class='storyDescription'><span class="storyIngress"><%= story.name%></span><br><span class="storyRest" style="color:grey"></span></p>
<% end %>
</ul>
<% end %>
@rtdp
rtdp / gist:742461
Created December 15, 2010 19:27
Importing Gmail Contacts list to Rails Application.
class ImportedContactsController << ApplicationController
require 'net/http'
require 'net/https'
require 'uri'
#THIS METHOD TO SEND USER TO THE GOOGLE AUTHENTICATION PAGE.
def authenticate
# initiate authentication w/ gmail
# create url with url-encoded params to initiate connection with contacts api
# next - The URL of the page that Google should redirect the user to after authentication.
# scope - Indicates that the application is requesting a token to access contacts feeds.
@mejibyte
mejibyte / gist:791105
Created January 22, 2011 12:56
Test Omniauth Callback Controllers in Devise
# encoding: utf-8
require 'test_helper'
class Users::OmniauthCallbacksControllerTest < ActionController::TestCase
context "Facebook callback" do
setup do
# This a Devise specific thing for functional tests. See https://github.com/plataformatec/devise/issues/closed#issue/608
request.env["devise.mapping"] = Devise.mappings[:user]
end
@scottwb
scottwb / assets.rake
Created January 28, 2011 06:08
Rake task to rebuild all JS/CSS assets with Compass/Jammit, including workaround for the bugs within.
namespace :assets do
task :rebuild do
# Config the base names of all the jammit CSS packages you have defined
# in assets.yml. Could probably parse assets.yml to get this if
# we wanted to.
packages = ['common']
# This is because on OS X, you have to put an explicit empty string to the
# required extension argument with the -i parameter, but on Linux you
# do not.
@visnup
visnup / import_issues.rb
Created July 31, 2011 19:54
hacky script to import pivotal tracker csv into github issues
#!/usr/bin/env ruby
require 'rubygems'
require 'FasterCSV'
require 'httparty'
require 'json'
class GitHub
include HTTParty
base_uri 'https://api.github.com'
@singhj
singhj / log
Created August 17, 2011 15:02 — forked from mingderwang/log
Give someone temporary access to your EC2 instance
Sometimes the easiest option is to give someone a key to your instance and revoke it after they are done.
We create a key pair, put the public key on the server, give them the private key.
To create the key pair for suzy,
cd ~/.ssh
ssh-keygen -b 1024 -f suzy -t dsa
cat suzy.pub >> authorized_keys
cat suzy
rm suzy*
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@danbronsema
danbronsema / rspec performance test
Created December 9, 2011 12:06
Performance testing in Rspec
context 'performance' do
before do
require 'benchmark'
@posts = []
@users = []
8.times do |n|
user = Factory.create(:user)
@users << user
aspect = user.aspects.create(:name => 'people')
connect_users(@user, @aspect0, user, aspect)
@christophercliff
christophercliff / documents.js
Created December 16, 2011 00:34
Base Classes for Binding Backbone.js to the CouchDB Documents API
(function(window, undefined){
window.Document = Backbone.Model.extend({
url: function () {
var self = this,
base = '/' + self.database;
if (self.isNew())
####################
### Dependencies ###
####################
require "optparse"
require "cinch"
require "cinch/logger/null_logger"
######################