Skip to content

Instantly share code, notes, and snippets.

View kent's full-sized avatar
👋

Kent Fenwick kent

👋
View GitHub Profile
@kent
kent / Kent's Rails Way Tab Helper.rb
Created May 20, 2009 03:17
Rails Tabbed Navigation Helper
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
def layout_link_to(link_text, path)
curl = url_for(:controller => request.path_parameters['controller'],
:action => request.path_parameters['action'])
html = ''
options = path == curl ? {:class => 'current'} : {}
html << content_tag("li", link_to(link_text, path, options))
end
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.
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.
<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="4" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relati
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\]"
#
# 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.
# 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.
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