Skip to content

Instantly share code, notes, and snippets.

extends React.Component{...
var Datum = React.createClass({
render: function() {
// chart properties
var dataSets = [
{
values: this.props.dataset1,
key: "Transmitted Signal",
color: '#1FB0C5'
},
import {List, Map} from 'immutable';
function setState(state, newState) {
return state.merge(newState);
}
function vote(state, entry) {
const currentPair = state.getIn(['vote', 'pair']);
if (currentPair && currentPair.includes(entry)) {
return state.set('hasVoted', entry);
//actions.js
attemptLogin(){
return (dispatch) =>{
dispatch({type: 'ATTEMPTING_LOGIN'}) //this sets the status on the store through the reducer
ref.authWithOAuthPopup("twitter", function(error, authData) {
if (error) {
console.log("Login Failed!", error);
return false
} else {
const mapDispatchToProps= (dispatch) => ({attemptLogin(){
dispatch(actions.attemptLogin())
}})
const Login = React.createClass({
contextTypes: {
router: React.PropTypes.object.isRequired
},
import React from 'react'
import {Link} from 'react-router'
const navMsg = ['Add Entries','Invite People', "See Who's Here", "Start The Vote"]
export default React.createClass({
//Server
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "babel-node index.js",
"test": "mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive",
"watch": "npm run test -- --watch"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<title>Pencil and Co</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="https://cdn0.iconfinder.com/data/icons/kameleon-free-pack-rounded/110/Chat-2-128.png" type="image/x-icon">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <!-- Compiled and minified JavaScript -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
import React, { Component } from 'react';
import {AppRegistry,StyleSheet,Text,View} from 'react-native';
class AwesomeProject extends Component {
render() {
return (
<View style={styles.container}>
<Text >
Days of the Week:
</Text>