(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.
#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) |
select generate_series as num, | |
case when generate_series % 15 = 0 | |
then 'fizzbuzz' | |
when generate_series % 3 = 0 | |
then 'fizz' | |
when generate_series % 5 = 0 | |
then 'buzz' | |
else '' end | |
as fizzbuzz | |
from generate_series(1, 100); |
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
class Category extends Model{ | |
public function subcategories(){ | |
return this->hasMany('App\Subcategory') | |
} | |
} |
(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:
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
concat = require('gulp-concat'), | |
gutil = require('gulp-util'), | |
uglify = require('gulp-uglify'), | |
postcss = require('gulp-postcss'), | |
nano = require('gulp-cssnano'), | |
concatCss = require('gulp-concat-css'), | |
autoprefixer = require('autoprefixer'), | |
sourcemaps = require('gulp-sourcemaps'), |
<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 |
[ | |
{ | |
"value": "Dateline Standard Time", | |
"abbr": "DST", | |
"offset": -12, | |
"isdst": false, | |
"text": "(UTC-12:00) International Date Line West" | |
}, | |
{ | |
"value": "UTC-11", |
{ | |
"AF": "Afghanistan", | |
"AX": "Åland Islands", | |
"AL": "Albania", | |
"DZ": "Algeria", | |
"AS": "American Samoa", | |
"AD": "AndorrA", | |
"AO": "Angola", | |
"AI": "Anguilla", | |
"AQ": "Antarctica", |