Skip to content

Instantly share code, notes, and snippets.

View tochman's full-sized avatar
💭
Coding on my own SaaS project (Rails + React)

Thomas Ochman tochman

💭
Coding on my own SaaS project (Rails + React)
View GitHub Profile
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>WebSocket Test</title>
<script src="https://unpkg.com/actioncable@5.1.4/lib/assets/compiled/action_cable.js"></script>
<script language="javascript" type="text/javascript">
(function () {
this.App || (this.App = {});
// App.cable = ActionCable.createConsumer('ws://localhost:3000/cable');
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CCCC Handlebars 2</title>
<link rel="stylesheet" href="https://cdn.rawgit.com/tochman/4d4acd3051e14a25d509d8a2e6fadd01/raw/7f664067a0fc8450b96e1bd4098401e903f6de7e/app.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.11/handlebars.js"></script>
</head>
@tochman
tochman / ar_migration_cheat_sheet.md
Last active November 25, 2017 08:14
Active Record Migration Cheat Sheet

Active Record Migrations

Migrations are a feature of Active Record that allows you to evolve your database schema over time. Rather than write schema modifications in pure SQL, migrations allow you to use an easy Ruby DSL to describe changes to your tables.

Migrations methods

  • up
    • change_table
    • create_table
    • add_column
    • add_index
    • change_column
@tochman
tochman / (0)index.hbs
Last active December 2, 2017 13:08
Coding for the Curious Crash Course - EmberJS resources
<div class=”container”>
<h1>Coding For The Curious Crash Course</h1>
</div>
@tochman
tochman / app.css
Created October 31, 2017 18:31
Coding for the Curious Crash Course - CSS resources
@import url('https://fonts.googleapis.com/css?family=Mukta+Vaani');
body {
background: #f2f2f2;
font-size: 14px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.card {
width: 30%;
@tochman
tochman / (1)app.component.ts
Last active September 19, 2017 13:01
Coding For The Curoius - Code samples
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'all workshop participants';
}
@tochman
tochman / index.html.erb
Created January 24, 2017 10:51
Capybara selectors with 'data-' attributes
<table>
<thead>
<tr>
<th>Name</th>
<th>Email></th>
<th>Country</th>
<th></th>
</tr>
</thead>
@tochman
tochman / env.rb
Last active November 29, 2016 16:39
SlowFood Sinatra setup
ENV['RACK_ENV'] = 'test'
require './lib/controller.rb'
require 'capybara'
require 'capybara/cucumber'
require 'rspec'
require 'pry'
require 'database_cleaner'
require 'database_cleaner/cucumber'
@tochman
tochman / Gemfile
Created July 6, 2016 09:46 — forked from eliotsykes/Gemfile
JavaScript testing in Rails 4.x with RSpec, Capybara, PhantomJS, Poltergeist
# Add poltergeist gem to Gemfile, in :test group,
# then run `bundle` to install
group :test do
...
gem 'poltergeist'
...
end
@tochman
tochman / spec_helper.rb
Last active January 17, 2018 17:01
Rspec settings for use with Middleman (acceptance tests)
require 'rspec'
require 'capybara/rspec'
require 'middleman-core'
require 'middleman-core/rack'
require 'middleman-livereload'
require 'middleman-deploy'
require 'middleman-sprockets'
middleman_app = ::Middleman::Application.new