Skip to content

Instantly share code, notes, and snippets.

View amalkov's full-sized avatar

Alex Malkov amalkov

View GitHub Profile
@amalkov
amalkov / 01-activerecord.rb
Created December 1, 2015 22:23 — forked from janko/01-activerecord.rb
PostgreSQL JSON querying in Sequel (my presentation from our local Ruby meetup)
require "active_record"
ActiveRecord::Base.establish_connection('postgres:///testing')
ActiveRecord::Migration.verbose = false
ActiveRecord::Migration.class_eval do
create_table :played_quizzes, force: true do |t|
t.integer :player_ids, array: true
t.json :quiz_snapshot
end

Front-end Tools

Test

Jasmine vs Mocha + Chai...

Linters

JSCS vs ESLint...

@amalkov
amalkov / 1.md
Created November 10, 2015 11:07 — forked from richardbatty/1.md
SOLID Workshops

Workshop 1

What is SOLID?

Requirements always change. We need to write code that is able to change in the future. The process of doing so is usually called design. Design principles are often-cited rules that lead to easily-changed code. Design principles have been derived from the initial goal: to have easily-changed code. They are not arbitrary rules. SOLID principles are an often-used set of design principles.

var EmailCatcher = (function($) {
// Initialiser function
var EmailCactcher = function(element) {
// Cache elements here that you will be accessing later in the class
this.$el = $(element);
this.$form = $('form', element);
this.$span = $('span', element);
// Do all your event binding for the future here too,
var EmailCatcher = (function($) {
// Initialiser function
var EmailCactcher = function(element) {
// Cache elements here that you will be accessing later in the class
this.$el = $(element);
this.$form = $('form', element);
this.$span = $('span', element);
// Do all your event binding for the future here too,
@amalkov
amalkov / test
Created March 13, 2013 23:56
test
test
@amalkov
amalkov / foo.rb
Created February 26, 2013 08:18
bar
foo

INSTALL

INSTALL cucumber & webrat (rspec rspec-rails)

$ [sudo] gem install rspec rspec-rails cucumber webrat

Starting from Cucumber 0.4.5 you will need the cucumber-rails gem

INSTALL DEPENDENCIES

INSTALL

INSTALL cucumber & webrat (rspec rspec-rails)

$ [sudo] gem install rspec rspec-rails cucumber webrat

Starting from Cucumber 0.4.5 you will need the cucumber-rails gem

INSTALL DEPENDENCIES

rspec-cheatsheet

INSTALL

$ gem install rspec

RSPEC-RAILS