Status Code | Status Message | Symbol |
---|---|---|
100 | Continue | :continue |
101 | Switching Protocols | :switching_protocols |
102 | Processing | :processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: nodejs | |
# Recipe:: default | |
# | |
# Build and install node.js | |
# | |
if ['app','app_master','solo'].include?(node[:instance_role]) | |
version_tag = "v0.4.8" | |
source_base_dir = "/data/nodejs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
... | |
#Problem: | |
#In rails 3.0.1+ it is no longer possible to do this anymore; | |
# rescue_from ActionController::RoutingError, :with => :render_not_found | |
# | |
#The ActionController::RoutingError thrown is not caught by rescue_from. | |
#The alternative is to to set a catch-all route to catch all unmatched routes and send them to a method which renders an error | |
#As in http://techoctave.com/c7/posts/36-rails-3-0-rescue-from-routing-error-solution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From http://blog.otoro.net/2015/11/24/mixture-density-networks-with-tensorflow/ | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import tensorflow as tf | |
import math | |
NHIDDEN = 24 | |
STDEV = 0.5 | |
KMIX = 24 # number of mixtures |