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
~/writermortis(master) [email protected] TEST_USER_PASSWORD=123456 TEST_USER_NAME=marti1125 ANON_PASSWORD=123456 rake db:seedrake aborted! | |
can't dup NilClass | |
/home/willy/writermortis/db/seeds.rb:9:in `dup' | |
/home/willy/writermortis/db/seeds.rb:9:in `<top (required)>' | |
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `load' | |
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `block in load' | |
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:236:in `load_dependency' | |
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:245:in `load' | |
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/railties-3.2.7/lib/rails/engine.rb:520:in `load_seed' | |
/home/willy/.rvm/gems/ruby-1.9.3-p392@global/gems/activerecord-3.2.7/lib/active_record/railties/databases.rake:309:in `block (2 levels) i |
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
# Add application configuration variables here, as shown below. | |
# | |
# PUSHER_APP_ID: "2954" | |
# PUSHER_KEY: 7381a978f7dd7f9a1117 | |
# PUSHER_SECRET: abdc3b896a0ffb85d373 | |
# STRIPE_API_KEY: EdAvEPVEC3LuaTg5Q3z6WbDVqZlcBQ8Z | |
# STRIPE_PUBLIC_KEY: pk_BRgD57O8fHja9HxduJUszhef6jCyS | |
# | |
# Copy this file to application.yml |
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
def create | |
@type = Type.find(params[:type_id]) | |
@product = @type.products.create(params[:product]) | |
if @product.save | |
redirect_to :action => :show, :id => @product.id | |
else | |
render 'new' | |
end | |
end |
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
sudo ./manage.py syncdb --noinput && ./manage.py migrate | |
Syncing... | |
11:16:1367000195 django.db.backends:DEBUG (0.023) | |
SELECT name FROM sqlite_master | |
WHERE type='table' AND NOT name='sqlite_sequence' | |
ORDER BY name; args=() :/home/willy/mozillians/vendor/src/django/django/db/backends/util.py:50 | |
Creating tables ... | |
11:16:1367000195 django.db.backends:DEBUG (0.001) SELECT "django_content_type"."id", "django_content_type"."name", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."model" = permission AND "django_content_type"."app_label" = auth ); args=('permission', 'auth') :/home/willy/mozillians/vendor/src/django/django/db/backends/util.py:50 | |
11:16:1367000195 django.db.backends:DEBUG (0.000) SELECT "django_content_type"."id", "django_content_type"."name", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."model" = group AND "django_co |
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
def describe_favorites(*games) | |
games.each{|game| puts "Favorite Game: #{game}"} | |
end | |
describe_favorites('Mario', 'Contra', 'Metroid') |
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
class Game | |
attr_accessor :name, :year, :system | |
attr_reader :created_at | |
def initialize(name, options={}) | |
@name = name | |
@year = options[:year] | |
@system = options[:system] | |
@created_at = Time.now | |
end | |
end |
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
{% if (user_form.errors or profile_form.errors) %} | |
<div class="alert alert-error"> | |
The following fields are required (optin is the checkbox in the last panel): | |
<ol> | |
{% for error in user_form.errors %} | |
<li>{{ error|escape }}</li> | |
{% endfor %} | |
{% for error in profile_form.errors %} | |
<li>{{ error|escape }}</li> | |
{% endfor %} |
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
class Library | |
attr_accessor :games | |
def initialize(games) | |
@games = games | |
end | |
end |
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
@allow_public | |
def register(request): | |
"""Registers Users. | |
Pulls out an invite code if it exists and auto validates the user | |
if so. Single-purpose view. | |
""" | |
if 'code' in request.GET: | |
request.session['invite-code'] = request.GET['code'] | |
return redirect('home') |
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
function randomUUID() { | |
var s = [], itoh = '0123456789ABCDEF'; | |
for (var i = 0; i <36; i++) s[i] = Math.floor(Math.random()*0x10); | |
s[14] = 4; | |
s[19] = (s[19] & 0x3) | 0x8; | |