Skip to content

Instantly share code, notes, and snippets.

@soeffing
soeffing / Model - Interview
Last active August 29, 2015 13:56
Pretty Model
module Legacy
class User < ActiveRecord::Base
# Constants
SENIORITY = {
0 => 'fan',
1 => 'novice',
2 => 'creative',
3 => 'senior',
4 => 'pro'
@soeffing
soeffing / Pretty Specs
Created February 28, 2014 17:24
Specs - Interview
1 require 'spec_helper'
2
3 describe User do
4 it 'I can create a new user' do
5 user = User.create(email: '[email protected]', fname: 'John', lname: 'Doe')
6 expect(user.id).to_not be_nil
7 end
8
9 it 'validates the required fields' do
10 user = User.new(email: nil, fname: nil, lname: nil)
@soeffing
soeffing / Gruntfile.js
Created September 4, 2013 09:30
Example of a Gruntfile.js configuration if you plan to develop with AngularJS and an Rails JSON API
// Generated on 2013-08-13 using generator-angular 0.3.1
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT });
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest;
// # Globbing