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
CREATE UNIQUE NONCLUSTERED INDEX index_users_reset_password_token | |
ON dbo.users (reset_password_token) | |
WHERE reset_password_token IS NOT NULL | |
ALTER INDEX index_users_on_reset_password_token | |
ON dbo.users (reset_password_token) | |
WHERE reset_password_token IS NOT NULL | |
REBUILD |
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
--------------------- SSHD Begin ------------------------ | |
Didn't receive an ident from these IPs: | |
58.174.96.26 (CPE-58-174-96-26.cxyh2.woo.bigpond.net.au): 1 Time(s) | |
Illegal users from: | |
undef: 6 times | |
oracle [preauth]: 2 times | |
db2inst1 [preauth]: 1 time |
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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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 Project < ActiveRecord::Base | |
attr_accessible :description, :name | |
has_many :user_projects | |
has_many :users, :through => :user_projects | |
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
class CreateProducts < ActiveRecord::Migration | |
def up | |
create_table :projects_users, :id => false do |t| | |
t.references :user, :null => false | |
t.references :project, :null => false | |
end | |
end | |
def down | |
drop_table :projects_users | |
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
class HomeController < ApplicationController | |
def index | |
@data = session[:omniauth_data] | |
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
be rake db:migrate | |
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/james/Code/CCE/Rakefile:9) | |
Connecting to database specified by database.yml | |
** vote_fu: initialized properly. | |
DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead. (called from <class:Feedback> at /Users/james/Code/CCE/app/models/feedback.rb:5) | |
PG::UndefinedTable: ERROR: relation "feedback" does not exist | |
LINE 5: WHERE a.attrelid = '"feedback"'::regclass | |
^ | |
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), | |
pg_get_expr(d.adbin, d.adrel |
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
irb(main):002:0> origin = TaxCloud::Address.new(address1: '7297 E. Shore Rd.', address2: '', city: 'traverse city', state: 'michigan', zip5: '49686') | |
=> #<TaxCloud::Address:0x007fc17f6e5080 @address1="7297 E. Shore Rd.", @address2="", @city="traverse city", @state="michigan", @zip5="49686"> | |
irb(main):003:0> dest = TaxCloud::Address.new(address1: '659 Cork Pine Ln.', address2: '', city: 'Vassar', state: 'michigan', zip5: '48768') | |
=> #<TaxCloud::Address:0x007fc17dce3e48 @address1="659 Cork Pine Ln.", @address2="", @city="Vassar", @state="michigan", @zip5="48768"> | |
irb(main):004:0> transaction = TaxCloud::Transaction.new(customer_id: 1, cart_id: 1, origin: origin, destination: dest) | |
=> #<TaxCloud::Transaction:0x007fc17f7d71c8 @cart_items=[], @customer_id=1, @cart_id=1, @origin=#<TaxCloud::Address:0x007fc17f6e5080 @address1="7297 E. Shore Rd.", @add | |
irb(main):005:0> transaction.cart_items << TaxCloud::CartItem.new(index: 1, item_id: 'sku-02', tic: TaxCloud::TaxCodes::GENERAL, price: '14.00', quantity: 2) | |
=> [#<Tax |
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
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
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 Product < ApplicationRecord | |
scope :published, -> { | |
where(:is_published => true) | |
} | |
belongs_to :category | |
validates_presence_of :name, :price | |
mount_uploader :image, ImageUploader | |
validates_processing_of :image |
OlderNewer