This file contains hidden or 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
fn main() { | |
let args = std::os::args(); | |
let env_var = "ZENDESK_SUBDOMAIN"; | |
let subdomain = std::os::getenv(env_var); | |
if subdomain == None { | |
print_env_error(env_var) | |
} else { |
This file contains hidden or 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
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
This file contains hidden or 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/lib/env ruby | |
# Acquires a shared lock on a SQLite database file and copies it to a backup | |
# | |
# usage: backup-db.rb DBFILE.db | |
# output: Creates backup copy of database to same directory with "dbbackup #{datetime}" prepended | |
# author: Paul Malenke (@paulmalenke), Forked from William Benton ([email protected]) at https://gist.github.com/willb/3518892 | |
# | |
# Public domain. | |