- What's the difference between a cookie and a session?
- What's serialization and how does it come into play with cookies?
- Can a cookie be shared by more than one user? How/why?
- What would it mean to store a shopping cart in a cookie?
- What advantages/disadvantages are there between cookie-stored carts and database-stored carts?
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
a = [1,4,9] | |
b = [2,3,5] | |
c = [6,7,8] | |
(a+b+c).sort | |
=> [1, 2, 3, 4, 5, 6, 7, 8, 9] |
This document is not a tutorial. It's intended to provide some context for understanding ReactJS, some helpful information on some its functionality, and how to get started.
This is a 'living doc' that will be continually updated and revised.
The Internet was originally created as a means to electronically share information via static files. This is the first website ever. As you can see, there's not much there. It's a static page, with some links to other pages. No JavaScript or database, just some HTML content. However, as the web became more popular, people began to discover new uses for it. We created ways to incorporate styles and images with CSS. This is a good example.
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
"dependencies": { | |
"babel-core": "^6.7.7", | |
"babel-loader": "^6.2.4", | |
"babel-preset-es2015": "^6.6.0", | |
"babel-preset-react": "^6.5.0", | |
"classnames": "^2.2.5", | |
"react": "^15.0.1", | |
"react-dom": "^15.0.1", | |
"webpack": "^1.13.0" |
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
var webpack = require('webpack'); | |
var path = require('path'); | |
module.exports = { | |
entry: [ | |
'./client/' | |
], | |
module: { | |
loaders: [ | |
{ test: /\.js?$/, loader: 'babel', exclude: /node_modules/ } |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// import SomeComponent from './components/SomeComponent'; | |
// import AnotherComponent from './components/AnotherComponent'; | |
const components = { | |
// Your components go here: | |
// 'SomeComponent': SomeComponent, | |
// 'AnotherComponent': AnotherComponent |
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
require 'json' | |
module ReactHelper | |
def react_component(component_name, props = {}) | |
content_tag( | |
:div, | |
nil, | |
class: 'react-component-target', | |
data: { |
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
namespace :assets do | |
task :precompile => :webpack | |
end | |
task :webpack do | |
sh "npm install" | |
sh "./node_modules/.bin/webpack" | |
end |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
body { | |
background-color: #E0E6ED; | |
color: #1F2D3D; |
OlderNewer