(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| blueprint: | |
| name: Calendar Notifications & Actions | |
| description: > | |
| # 📅 Calendar Notifications & Actions | |
| **Version: 1.3** | |
| The most common automation used for calendar notifications & actions. | |
| body { | |
| background-image: | |
| linear-gradient(45deg, #ccc 25%, transparent 25%), | |
| linear-gradient(135deg, #ccc 25%, transparent 25%), | |
| linear-gradient(45deg, transparent 75%, #ccc 75%), | |
| linear-gradient(135deg, transparent 75%, #ccc 75%); | |
| background-size:25px 25px; /* Must be a square */ | |
| background-position:0 0, 12.5px 0, 12.5px -12.5px, 0px 12.5px; /* Must be half of one side of the square */ | |
| } |
| // The reducer function looks at each action that comes in | |
| // and based on the type generates a new state based on the | |
| // previous state and any additional data the action carried | |
| const reducer = (state, action) => { | |
| switch (action.type) { | |
| case "COUNT_INCREMENT": | |
| return { | |
| ...state, | |
| count: state.count + 1 | |
| }; |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
| <div class="col-md-8 col-md-offset-1"> | |
| <div class="panel panel-default"> | |
| <%= form_for(@weekly_performance_review) do |f| %> | |
| <% if @weekly_performance_review.errors.any? %> | |
| <div id="error_explanation"> | |
| <h2><%= pluralize(@weekly_performance_review.errors.count, "error") %> prohibited this weekly_performance_review from being saved:</h2> | |
| <ul> | |
| <% @weekly_performance_review.errors.full_messages.each do |message| %> | |
| <li><%= message %></li> |
| do ($ = jQuery, exports = window) -> | |
| class ActiveDataBinder | |
| constructor: (uid) -> | |
| # Use a jQuery object as simple PubSub | |
| pubSub = $ {} | |
| # We expect a 'data' attribute specifying the binding |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| # Simple bijective function | |
| # Basically encodes any integer into a base(n) string, | |
| # where n is ALPHABET.length. | |
| # Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047 | |
| ALPHABET = | |
| "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//) | |
| # make your own alphabet using: | |
| # (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join |