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
console.log "Hello World" | |
superheroes = ["superman", "thor", "batman"] | |
for hero in superheroes | |
console.log hero | |
person_1 = | |
name: "Zack" | |
email: 'zack@artellectual.com' |
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 'benchmark' | |
class Selector | |
def initialize(key) | |
@key = key | |
end | |
def selector_if | |
if @key == :success |
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
defmodule Bank do | |
use Application.Behaviour | |
# See http://elixir-lang.org/docs/stable/Application.Behaviour.html | |
# for more information on OTP Applications | |
def start(_type, _args) do | |
Bank.Supervisor.start_link | |
end | |
def start do |
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
(0..10).each do |i| | |
"/Users/blah/#{i}.html" | |
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
mongoid (2.0.2) lib/mongoid/relations/referenced/many.rb:219:in `block in load!' | |
mongoid (2.0.2) lib/mongoid/relations/referenced/many.rb:217:in `tap' | |
mongoid (2.0.2) lib/mongoid/relations/referenced/many.rb:217:in `load!' | |
mongoid (2.0.2) lib/mongoid/relations/referenced/many.rb:400:in `method_missing' | |
i18n (0.5.0) lib/i18n/exceptions.rb:41:in `block in initialize' | |
i18n (0.5.0) lib/i18n/exceptions.rb:41:in `each' | |
i18n (0.5.0) lib/i18n/exceptions.rb:41:in `initialize' | |
i18n (0.5.0) lib/i18n/backend/base.rb:37:in `new' | |
i18n (0.5.0) lib/i18n/backend/base.rb:37:in `translate' | |
i18n (0.5.0) lib/i18n.rb:155:in `translate' |
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
<%= form_for @user, validate: true do |f| %> | |
<% if @user.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2> | |
<ul> | |
<% @user.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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 User | |
include Mongoid::Document | |
devise :database_authenticatable,:registerable,:omniauthable,:recoverable, :rememberable, :trackable , :timeoutable , :confirmable #, :validatable | |
devise :encryptable, :encryptor => 'sha512' | |
validates_presence_of :email, :if => :sign_up | |
validates_presence_of :email, :first_name, :last_name, :add1, :add2, :id_number, :if => :edit_page | |
validates_uniqueness_of :email , :case_sensitive => true | |
attr_accessor :edit_page, :sign_up | |
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
validates_presence_of :email, :if => :sign_up | |
validates_presence_of :email, :first_name, :last_name, :add1, :add2, :id_number, :if => :edit_page | |
validates_uniqueness_of :email , :case_sensitive => true | |
attr_accessor :edit_page, :sign_up | |
references_many :transactions, :dependent => :delete, :inverse_of => :user | |
field :customer_id, type: Integer, default: 0 | |
field :title, type: String | |
field :first_name, type: String |
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
namespace "api" do | |
resources :contacts | |
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
match ':account_id/*path', to: 'launcher#index' |
OlderNewer