Skip to content

Instantly share code, notes, and snippets.

View wearethefoos's full-sized avatar

Wouter de Vos wearethefoos

View GitHub Profile
.DS_Store
node_modules
npm-debug.log
dist
import React from 'react';
class Categories extends React.Component {
render() {
return (
<h1>Categories!</h1>
);
}
}
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, Link, browserHistory } from 'react-router';
import App from './App';
import Categories from './Categories';
import Category from './Category';
import Games from './Games';
import Game from './Game';
import PageNotFound from './PageNotFound';
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.before(:suite) do
if config.use_transactional_fixtures?
raise(<<-MSG)
Delete line `config.use_transactional_fixtures = true` from rails_helper.rb
(or set it to false) to prevent uncommitted transactions being used in
JavaScript-dependent specs.
class Utils {
uuid() {
var i, random;
var uuid = '';
for (i = 0; i < 32; i++) {
random = Math.random() * 16 | 0;
if (i === 8 || i === 12 || i === 16 || i === 20) {
uuid += '-';
}
import SocketClient from 'socket.io-client';
import Feathers from 'feathers-client';
import Utils from '../lib/Utils';
const API_HOST = "http://localhost:3030";
class BaseModel {
defaults() { return {}; }
constructor(resource_name, host = API_HOST) {

Git Assignment

  • Make teams of 2 to 3 ppl
  • One creates a Repository and adds the rest of the team as collaborators (see repo "Settings")
  • All of you clone the repository on your local machine (make sure you are not cloning inside another git repo!)
    • git clone git@github.com:NAME/REPO.git
  • Recreate the Beer project together, but spread the work in different files, e.g.:
class Beer
# We ONLY want to be able to read @amount, not
# change it without calling "sip!"
attr_reader :amount
def initialize
@amount = 250
end
def sip!

Carrierwave Example Uploader

Steps

  • Add gem 'carrierwave' to Gemfile
  • Run bundle install to install the new gem
  • Stop spring: spring stop
  • Run rails generate uploader Image
  • Mount the newly generated ImageUploader on your Model. I mounted it on the string type column image by adding this in my model's class: