Skip to content

Instantly share code, notes, and snippets.

require 'spec_helper'
require 'pry'
describe User do
before do
@user = User.new(name: "Example User", email: "user@example.com")
end
subject { @user }
class User < ActiveRecord::Base
before_save { self.email = email.downcase }
EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :name, presence: true, length: { maximum: 50 }
validates :email, presence: true, format: { with: EMAIL_REGEX }, uniqueness: { case_sensitive: false }
end
@jacobsmith
jacobsmith / gist:7624674
Created November 24, 2013 08:09
.vimrc
set nocompatible
syntax on
filetype on
filetype indent on
set expandtab
set shiftwidth=2
set softtabstop=2
set number
set incsearch
require 'spec_helper'
describe Student do
before do
@student = FactoryGirl.create(:student)
end
subject { @student }
/* multiplication_a_la_russe.c
* multiplication a la russé
*/
#include <stdio.h>
int main()
{
int op1, op2, total_sum = 0;
I'm working on a Rails app that's designed for research projects. I have what I think the model/database layout should be,
but am having trouble implementing it (thus, I figured there was probably something small, either in implementation or
design, that should be looked at). The overall schema I'm working with is as follows:
User
| -username
| -password
|
\
Project
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFOuWZQBCACVzA6Go/1rMHnjvgX+4QMCv2gs9r9F0lIXd4+R+rlny5TSAUmN
RhuyQQzW8KzPAUeSbVimqRR5DgjFmJtKMDjg0j9yTTjemhAob8H7z+dBMr1oDYyA
tbKz9bxWDEikFfJl545oNHxwKLdntp3x473VZ4J0/oqQgj+GLb+BDX+QlORwJlCy
ajjKzUhKWRdGOzJ8GX828c+AwwXj+LSZiBsnXWvbcj4I8JINYO9AJJKmHOs7RU7D
vS43rh7cJ8F0aWof/z4wvlQcBziXi2H7gmzV6L83DCfspyxn4Cfz0qHC1X20TKH7
t2110UqjaAWocx5qoZAMS1s/VGqT4wZpQgX7ABEBAAG0KkphY29iIFNtaXRoIDxq
YWNvYi53ZXNsZXkuc21pdGhAZ21haWwuY29tPokBPwQTAQIAKQUCU65ZlAIbAwUJ
hello world this is jacob
;';;;;';;;;;;;;;;;;;;;;;;;'';''';;;;;';;;;;;;';;;;;;;;'+++'+###+++#++++'''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;';;'+++####+#+++######++'''+'++###+##++'''''''''''''''''''''
';';;;;;;;;;;;;;;;';;;;;;;;'''''''';;;;;;;;;;;;';;;;;';'''''+##+++##++'';;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;;;;;'';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;';;'##+++#++#+#+###+##++'''++##########+''''''''''''''''''''
;;'';;;;;';;;;'';;;;;;';;;;';'';;;;;';;';;;';;';'';';'';;'''+#++'+++'''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;++++++++++#+++##+++''''+####@#@@####++'''''''''''''''''''
;;';;;;;;;';;;;';;;;;;;;;;;;''';';;';';';''';;;';'';;'';;';;'++'''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;';;';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'+###++++########++++'++##@@@@@@@@##@#+'''''''''''''''''''
';;;;;;;;'';;;;;;;;;;;'''';;;;''''';'';'''''''';;';;;';;;;;;;;''';;;;'';;';;;;;;';;;;;;;;';;;;';;;;;;;;;;;;;'''';';;;;;;;;;;;;;;;;;;;;;;;;;;;;;'++###+##+######+++'+###@##@##@@@@@@##'''''''''''''''''''
';;;';;;;;;;;;;;;;
(("iloveyOuilOveyouiloveyOuilOveyOuiloveyouilOveyouilOveyOuilOv".unpack('B*')[0]<<"011").split(/(.{21})/) - [""]).map { |i| puts(i.split("").join(" ")) }