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
class UserSession < Authlogic::Session::Base | |
def remember_me_for | |
3.months | |
end | |
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
<!-- Someone can visit http://localhost:3000/profiles/my-permalink and this page will display (this part is working fine!). --> | |
<h2>Edit your profile, <%= @user.first_name %>.</h2> | |
<%= form_for @user, :html => { :class => "form-horizontal"} do |f| %> | |
<%= f.label :first_name, "Your First Name" %> | |
<%= f.text_field :first_name %> | |
<%= f.submit "Update Profile" %> | |
<% 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
module.exports = function(server) { | |
var request = require("supertest"); | |
it("[GET] /", function(done) { | |
request(server).get("/").expect(200, done); | |
}); | |
it("[GET] /posts", function(done) { | |
request(server).get("/posts").expect(200, 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
apache: | |
install: '1' | |
settings: | |
user: www-data | |
group: www-data | |
default_vhost: true | |
manage_user: false | |
manage_group: false | |
sendfile: 0 | |
modules: |
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
gulp.task("concat:js", function() { | |
// Loop through each JS collection and run a seperate concat task | |
Object.keys(collections.js).forEach(function(name) { | |
gulp.src(collections.js[name]) | |
.pipe(concatJS("collections/" + name + ".js")) | |
.pipe(gulp.dest(paths.dest.javascript)); | |
}); | |
}); |
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
var gulp = require("gulp"); | |
var collections = require("./collections"); | |
gulp.task("concat-css", function() { | |
Object.keys(collections).forEach(function(name) { | |
gulp.src(collections[name]) | |
.pipe(plugins.concatCSS("collections/" + name + ".css")) | |
.pipe(gulp.dest("assets/stylesheets")); | |
}); | |
}); |
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
# Save the answer into a variable called 'num'. | |
num = input("How many underscores do you want, yo?: ") | |
# Multiply "_" by the amount specified before... | |
underscores = "_" * int(num) | |
# Print out the smiley face! | |
print("^" + underscores + "^") |
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
#!/usr/bin/env bash | |
source ~/.rvm/scripts/rvm | |
rvm use | |
#`deploy.sh` v0.0.1 by Adam McArthur. | |
# Deploys code from a GitHub repository to an ec2 instance. | |
# It is reccommended that the current user can use "sudo" without a password [you might need to use sudo from inside this script], | |
# See: http://askubuntu.com/questions/235084/how-do-i-remove-ubuntus-password-requirement#answer-235088 | |
##### SETTINGS [Change Me] ##### |
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
#!/usr/bin/env sh | |
source ~/.rvm/scripts/rvm | |
rvm use 2.2.0 | |
app_name="App" | |
apps_dir="/var/www" | |
github_username="adammcarth" | |
git_repo="filthy_parrot" | |
app_install_commands="bundle install" |
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 truncate(string, words) { | |
var max_chars = 6 * parseInt(words); | |
var words_array = string.split(" "); | |
var index = parseInt(words) - 1; | |
var truncated = words_array.slice(0, index).join(" "); | |
if ( truncated.length > max_chars ) { | |
truncated = string.slice(0, max_chars) + "..."; | |
} else if ( truncated === string ) { | |
truncated = string; |