Skip to content

Instantly share code, notes, and snippets.

View Archimidis's full-sized avatar

Nikolas Vourlakis Archimidis

View GitHub Profile
@Archimidis
Archimidis / example-tests-wedotdd.js
Created December 12, 2017 12:18 — forked from dschinkel/example-tests-wedotdd.js
Example Tests from Private Repo for WeDoTDD.com
/*
Tools: mocha, chai-enzyme, jsdom, airbnb enzyme
Using WebStorm test runner and WebStorm to write code.
For the prod code, using Flow for type checking
These are isolated unit tests (not integration) that test behavior for particular React components
A big reason why I like React.js vs Vue, Angular, or other types of frameworks or
libraries is the simplicity at which you can test behavior. Also there's no magic going on here in terms of
@Archimidis
Archimidis / gist:13bd1b5c54cb342ad075
Created March 10, 2016 09:55 — forked from skroah/gist:9c22697521626c7b388b
Reactive Systems Design

##Reactive System Design Links

#Articles and Papers

@Archimidis
Archimidis / 0_reuse_code.js
Created January 27, 2014 08:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Archimidis
Archimidis / new_invitation.html.erb
Created January 19, 2014 02:33 — forked from mikeatlas/new_invitation.html.erb
Rails: Invitations with devise_invitable
<!-- /app/views/admin/users/new_invitiations.html.erb -->
<h2>Send invitation</h2>
<%= form_for @user, :url => send_invitation_admin_users_path do |f| %>
<table style='width: 50%'>
<tr>
<td><%= f.label :first_name %></td>
<td><%= f.text_field :first_name %></td>
@Archimidis
Archimidis / application_controller.rb
Created July 29, 2013 14:05 — forked from gonzedge/application_controller.rb
Custom dynamic 404 and 500 pages
class ApplicationController < ActionController::Base
# ...
unless Rails.application.config.consider_all_requests_local
rescue_from Exception, with: lambda { |exception| render_error 500, exception }
rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception }
end
private
def render_error(status, exception)
class ApplicationController < ActionController::Base
...
# FORCE to implement content_for in controller
def view_context
super.tap do |view|
(@_content_for || {}).each do |name,content|
view.content_for name, content
end
end
end