This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GetByID returns an Account instance given its id which is either: | |
// username or email. | |
func (r *RepoPostgres) GetByID(id string) (*Account, error) { | |
a := new(account) | |
err := r.db.Get(a, "SELECT * FROM accounts WHERE username = $1 OR email = $1", id) | |
if err != nil { | |
return nil, translateError(err) | |
} | |
a.Account.PictureURL, _ = url.Parse(a.PictureURL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do | |
name=`echo "$branch" | sed 's|remotes/origin/||'` | |
git branch --track "${name}" "$branch" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package mailer wraps Mandrill's REST API only for sending emails using templates. | |
package mailer | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "log" | |
var i int | |
func bsearch(target int, array []int) int { | |
low := 0 | |
hi := len(array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
camilo@levitas:~/Development/ruby/cucumber/examples/selenium_webrat$ rake features | |
(in /home/camilo/Development/ruby/cucumber/examples/selenium_webrat) | |
/usr/bin/ruby1.8 -I "/home/camilo/Development/ruby/cucumber/lib:lib" "/home/camilo/Development/ruby/cucumber/bin/cucumber" --format pretty --require features/step_definitons/search_steps.rb --require features/support/env.rb features/search.feature | |
Feature: Search | |
In order to learn more | |
As an information seeker | |
I want to find more information | |
Scenario: Find what I'm looking for # features/search.feature:6 | |
==> Waiting for Selenium RC server on port 4444... . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20:36:02.868 ERROR - Failed to start new browser session, shutdown browser an clear all session data | |
org.openqa.selenium.server.RemoteCommandException: timed out waiting for window 'null' to appear | |
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:565) | |
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:522) | |
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:324) | |
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:118) | |
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:81) | |
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:658) | |
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:392) | |
at org.openqa.selenium.server.SeleniumDriverResourceHandler.han |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
camilo@levitas:~/Development/ruby/cucumber/examples/selenium_webrat$ rake features | |
(in /home/camilo/Development/ruby/cucumber/examples/selenium_webrat) | |
/usr/bin/ruby1.8 -I "/home/camilo/Development/ruby/cucumber/lib:lib" "/home/camilo/Development/ruby/cucumber/bin/cucumber" --format pretty --require features/step_definitons/search_steps.rb --require features/support/env.rb features/search.feature | |
Feature: Search | |
In order to learn more | |
As an information seeker | |
I want to find more information | |
Scenario: Find what I'm looking for # features/search.feature:6 | |
==> Waiting for Selenium RC server on port 4444... . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
camilo@levitas:~/Development/ruby/cucumber/examples/selenium_webrat$ rake features | |
(in /home/camilo/Development/ruby/cucumber/examples/selenium_webrat) | |
Feature: Search | |
In order to learn more | |
As an information seeker | |
I want to find more information | |
Scenario: Find what I'm looking for # features/search.feature:6 | |
==> Waiting for Selenium RC server on port 4444... . | |
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'singleton' | |
class Configuration | |
include Singleton | |
def initialize | |
config_file = File.join(RAILS_ROOT, "config", "application.yml") | |
if File.exists?(config_file) | |
config = YAML.load(File.read(config_file))[RAILS_ENV] |