Skip to content

Instantly share code, notes, and snippets.

View lienvdsteen's full-sized avatar

Lien Van Den Steen lienvdsteen

View GitHub Profile
root = true
# Keep these unchanged
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@lienvdsteen
lienvdsteen / anatomy.md
Last active January 18, 2018 07:57
The Anatomy of a Rails Project

Here's a quick overview of what each folder/file in our Rails project is:

  • app/: This folder is where most of your application-specific code will go into.
  • bin/: This folder contains executable scripts for your rails project. These are the files that get executed when you run bundle, rails, or rake from the command line.
  • config/: This is for your application's configuration files. The environment folder contains environment-specific (development, production, test) configuration, and all files in the initializers folder will be run when your application boots.
  • db/: This folder contains files for managing your database. Generated migrations will be put into the migrate folder, and a master copy of your application's database schema is contained in schema.rb, which is automatically updated when you run migrations.
  • lib/: This folder contains code that doesn't belong in the app or vendor folder. Any .rake files in lib/tasks will be made available to the rake command.
  • log/: This is where you
<!DOCTYPE html>
<html>
<head>
<title>Floating</title>
<style type="text/css">
#wrapper {
margin: 0 auto;
width: 900px;
background-color: red;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>--- TODO ---</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
64 bytes from 173.194.112.3: icmp_seq=4911 ttl=53 time=86.417 ms
64 bytes from 173.194.112.3: icmp_seq=4912 ttl=53 time=146.898 ms
64 bytes from 173.194.112.3: icmp_seq=4913 ttl=53 time=27.722 ms
64 bytes from 173.194.112.3: icmp_seq=4914 ttl=53 time=31.395 ms
64 bytes from 173.194.112.3: icmp_seq=4915 ttl=53 time=25.816 ms
64 bytes from 173.194.112.3: icmp_seq=4916 ttl=53 time=33.610 ms
64 bytes from 173.194.112.3: icmp_seq=4917 ttl=53 time=33.367 ms
64 bytes from 173.194.112.3: icmp_seq=4918 ttl=53 time=30.606 ms
64 bytes from 173.194.112.3: icmp_seq=4919 ttl=53 time=33.231 ms
64 bytes from 173.194.112.3: icmp_seq=4920 ttl=53 time=28.821 ms
@lienvdsteen
lienvdsteen / application.html.erb
Created June 26, 2015 15:19
Google Maps Autocomplete
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places&amp;key=APIKEY"></script>
@lienvdsteen
lienvdsteen / application_controller.rb
Created June 17, 2015 16:03
Allow other params for devise
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
before_action :configure_permitted_parameters, if: :devise_controller?
protect_from_forgery with: :exception
before_action :authenticate_user!
protected
def configure_permitted_parameters
@lienvdsteen
lienvdsteen / development.rb
Last active August 29, 2015 14:23
Rails Mailing
# add this to the file
config.action_mailer.delivery_method = :letter_opener
@lienvdsteen
lienvdsteen / vehicle.rb
Created May 13, 2015 09:41
Basic example used for OOP in Ruby
class Vehicle
attr_reader :number_of_wheels, :needs_gas, :driven_km
def initialize(number_of_wheels, engine_type)
@number_of_wheels = number_of_wheels
@engine_type = engine_type
@needs_gas = true
@driven_km = 0
@engine_started = false