#Mac OS X
##References
##Create Rails App
command to make new directory:
mkdir AppName
- mkdir vagrant
- cd vagrant
- vagrant box add ubuntu http://dl.dropbox.com/u/7490647/talifun-ubuntu-11.04-server-i386.box
- vagrant init ubuntu
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
#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 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
source 'http://rubygems.org' | |
gem 'rails', '3.1.0' | |
gem 'unicorn' | |
gem "mongoid", "~> 2.4" | |
gem "bson_ext", "~> 1.5" | |
gem 'jquery-rails' | |
gem 'sorcery' | |
gem 'cancan' | |
gem 'twitter-bootstrap-rails', :git => 'http://github.com/seyhunak/twitter-bootstrap-rails.git' |
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 MySQL { | |
/** | |
* The DB Host to connect to | |
* | |
* @var string | |
*/ | |
protected $host; |
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 TestCountriesSpec extends Specification { | |
val appWithMemoryDatabase = FakeApplication(additionalConfiguration = inMemoryDatabase()) | |
abstract class WithDbData extends WithApplication(appWithMemoryDatabase) { | |
override def around[T: AsResult](t: => T): Result = super.around { | |
setupData() | |
t | |
} |
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/python | |
import argparse, getopt, sys | |
parser = argparse.ArgumentParser(description='Writes SQL inserts based off a CSV file. Assumes values are strings.') | |
parser.add_argument('file', help='name and location of the file to parse') | |
parser.add_argument('table', help='table name on which inserts will be based') | |
parser.add_argument('cols', help='comma-separated value of the columns to write') | |
args = parser.parse_args() |
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
require 'rubygems' | |
require 'twitter' | |
# see https://github.com/sferik/twitter | |
def twitter_client | |
Twitter::REST::Client.new do |config| | |
config.consumer_key = "XXXXXX" | |
config.consumer_secret = "XXXXXX" | |
config.access_token = "XXXXXX" |
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
#!/bin/sh | |
# | |
# Copyright (c) 2005 Junio C Hamano | |
# | |
# Fetch one or more remote refs and merge it/them into the current HEAD. | |
USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff|--ff-only] [--[no-]rebase|--rebase=preserve] [-s strategy]... [<fetch-options>] <repo> <head>...' | |
LONG_USAGE='Fetch one or more remote refs and integrate it/them with the current HEAD.' | |
SUBDIRECTORY_OK=Yes | |
OPTIONS_SPEC= |
OlderNewer