Skip to content

Instantly share code, notes, and snippets.

View patrickcurl's full-sized avatar

Patrick Curl patrickcurl

View GitHub Profile
# config/environments/development
# ActionMailer Config
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
# change to true to allow email to be sent during development
config.action_mailer.perform_deliveries = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
#config.action_mailer.default_url_options = { :host => 'your.websitedomain.com' }
config.action_mailer.smtp_settings = {
@patrickcurl
patrickcurl / User.rb
Created January 16, 2013 21:52 — forked from parndt/User.rb
# == Schema Information
# Schema version: 20130116180743
#
# Table name: users
#
# id :integer not null, primary key
# name :string(255)
# email :string(255)
# created_at :datetime not null
# updated_at :datetime not null
// Bonfire: Meet Bonfire
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-meet-bonfire#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function meetBonfire(argument) {
// Good luck!
console.log("you can read this function's argument in the developer tools", argument);
return true;
// Bonfire: Reverse a String
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-reverse-a-string#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function reverseString(str) {
return str.split('').reverse().join('');
}
reverseString("hello");
// Bonfire: Factorialize a Number
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-factorialize-a-number#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function factorialize(num) {
var total = 1;
for(var i=1;i<=num;i++){
total = total * i;
}
// Bonfire: Check for Palindromes
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function palindrome(str) {
// Good luck!
var myStr = str.replace(/[^A-Za-z0-9]/g, '').toLowerCase();
reverseStr = myStr.split('').reverse().join('');
if(myStr === reverseStr){
// Bonfire: Find the Longest Word in a String
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-find-the-longest-word-in-a-string#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function findLongestWord(str) {
var words = str.split(" ");
var longestWord = words[0];
for(i=0;i<words.length;i++){
// Bonfire: Title Case a Sentence
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-title-case-a-sentence#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function titleCase(str) {
words = str.split(" ");
for(var i=0;i<words.length;i++){
words[i] = words[i].charAt(0).toUpperCase() + words[i].substr(1).toLowerCase();
}
// Bonfire: Return Largest Numbers in Arrays
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-return-largest-numbers-in-arrays#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function largestOfFour(arr) {
// You can do this!
var largest = [];
for(var i=0;i<arr.length;i++){
largest[i] = arr[i][0];
// Bonfire: Confirm the Ending
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-confirm-the-ending#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
if(str.substr(-target.length) === target){
return true;