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
def layout_link_to(link_text, path, opts = {}) | |
curl = url_for(:controller => request.path_parameters['controller'], | |
:action => request.path_parameters['action']) | |
html = '' | |
options = curl.include?(path) ? {:class => 'current'} : {} | |
if opts[:class] && options[:class] | |
options[:class] = "current #{opts[:class]}" | |
else | |
options.merge!(opts) | |
end |
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
// jQuery Colourizer | |
// Kent Fenwick 2009 | |
// Use it when you want to add a splash of random colour to your page | |
// Create the colour array | |
var color_array = ["#ce521d","#ca4b89","#006b89","#3e2d7e","#61902c", "#faa31a", "#6e002a", "#4981b3", | |
"#980069", "#2dacbf", "#ee1d25", "#9cb46f", "#9a869e", "#ee008c", "#00a895", | |
"#7b181a", "#ffd63c", "#b46638", "#bcd634", "#f4ea00", "#32b6c0", "#e8ac1c", | |
"#ea2d50", "#3c7022", "#0085cc", "#97C83B"]; | |
// Pick a random colour of the 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
Hello, | |
Thank you very much for agreeing to participate in the Friend Forecaster Pilot Study. We are eager to get you started and hear your feedback. | |
Friend Forecaster is a web application that is designed to help you remember names. It would be great if that was the end of the story but in order to get the most out of Friend Forecaster you are going to have to do a little bit of work. | |
Friend Forecaster is powered by the people you know or want to know, the places you go, the activities you do and the groups that you are apart of. The idea is that by knowing about these things and relating them with tags / labels the system will be able to give you suggested lists of people you might see. | |
That is really all that we want to tell you at the moment since you are a pilot participant and we want to see how you use the system on your own during the study. |
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
Feature: User signs up to my awesome website | |
As a user who is not signed up | |
I want to sign up to the awesome website | |
So that I can use the awesome site | |
Scenario: sign up voluntarily | |
Given I am at the homepage | |
When I click the signup button | |
Then I should be brought to the signup page | |
And I should see a signup form. | |
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
function proml { | |
local BLACK="\[\033[0;30m\]" | |
local D_GREY="\[\033[1;30m\]" | |
local BLUE="\[\033[0;34m\]" | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" | |
local LIGHT_GREEN="\[\033[1;32m\]" | |
local WHITE="\[\033[1;37m\]" | |
local LIGHT_GRAY="\[\033[0;37m\]" |
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
# | |
# Cookbook Name:: delayed_job | |
# Recipe:: default | |
# | |
if %w(solo app app_master).include?(node[:instance_role]) | |
user = node[:owner_name] | |
framework_env = node[:environment][:framework_env] | |
# Be sure to replace APP_NAME with the name of your application. |
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
# include this in application controller | |
module Authentication | |
protected | |
# Inclusion hook to make #current_user and #signed_in? | |
# available as ActionView helper methods. | |
def self.included(base) | |
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method | |
end | |
# Returns true or false if the user is signed in. |
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
Hi all. | |
Trying to do this | |
class Person < ActiveRecord::Base | |
include EasySelectFields | |
easy_select_fields "status", ["Interested", "Not Interested", "Available"] |
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
module EasySelectFields | |
def easy_select_fields(a,options) | |
type_method_name = "#{a}_types".to_sym | |
array = options.each_with_index.map {|o,i| [o, i += 1] } | |
class_eval "def self.#{a}_types() #{array.inspect} end" | |
end | |
end | |
class Person |
OlderNewer