Note:
<example>
is meant to denote text replaced by you (including brackets).
// global dependencies
npm install -g knex
Puma::Plugin.create do | |
def production? | |
ENV.fetch('RACK_ENV', 'development') == 'production' | |
end | |
def log(msg) | |
if production? | |
Rails.logger.info msg | |
else | |
puts msg |
Puma::Plugin.create do | |
def production? | |
ENV.fetch('RACK_ENV', 'development') == 'production' | |
end | |
def log(msg) | |
if production? | |
Rails.logger.info msg | |
else | |
puts msg |
-- Somewhere in you Elm app you can add editor by adding an empty node with the correct attributes. | |
-- The JS library will be initialized and destroyed automatically! | |
view : Model -> Html Msg | |
view model = | |
div [] | |
[ div | |
[ attribute "data-ace" "" | |
, attribute "data-ace-theme" "monokai" | |
, attribute "data-ace-mode" "javascript" |
module Main exposing (..) | |
import RemoteData exposing (WebData, RemoteData(..), asCmd, fromTask) | |
import Html exposing (Html, text, div, input, br) | |
import Html.Events exposing (onClick) | |
import Html.Attributes exposing (type_, value) | |
import Http exposing (get, toTask) | |
import Json.Decode exposing (Decoder, string) | |
import Json.Decode.Pipeline exposing (decode, required) | |
import Random exposing (int, generate) |
class Entry < ActiveRecord::Base | |
validates :status_weather, inclusion: { | |
in: EntryStatus::OPTIONS[:weather] | |
} | |
validates :status_landform, inclusion: { | |
in: EntryStatus::OPTIONS[:landform] | |
} |
A top-level App
component returns <Button />
from its render()
method.
What is the relationship between <Button />
and this
in that Button
’s render()
?
Does rendering <Button><Icon /></Button>
guarantee that an Icon
mounts?
Can the App
change anything in the Button
output? What and how?
require 'webrick' | |
require 'faraday' | |
require 'em-http' | |
require 'net/http/persistent' | |
require 'httpclient' | |
require 'typhoeus' | |
require 'typhoeus/adapters/faraday' | |
require 'patron' | |
require 'excon' |
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |