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
Template.leaderboard.events({ 'click input.inc': function () { Players.update(Session.get("selected_player"), {$inc: {score: 5}}); console.log(Session.get("sort_order")); }, 'click input.sort_order': func |
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
// productView.html | |
<template name="productView"> | |
{{title}} | |
</template> | |
// routes.js | |
Router.map(function () { | |
this.route('home', { | |
path: '/' |
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 BrandSubscriptionsController < ApplicationController | |
before_filter :require_login | |
def new | |
flash.clear | |
render :new, :layout => "brands" | |
end | |
def create | |
Rails.logger.info('___ agreed:' + params[:brand_subscription][:agreed_to_terms] + '<<') |
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
// https://github.com/expressjs/cors | |
var express = require('express'), cors = require('cors'), app = express(); | |
//var corsOptions = { | |
// origin: 'http://130.211.164.16:8282/' | |
//}; | |
express.static.mime.define({'text/javascript': ['js']}); | |
app.use(cors()); | |
app.use(express.static('public')); |
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
const choo = require('choo') | |
const app = choo() | |
function view (params, state, send) { | |
return choo.view` | |
<main> |
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
const choo = require('choo') | |
const app = choo() | |
function view (params, state, send) { | |
let newView = choo.view` | |
<main> | |
<h1>${state.title}</h1> | |
<ul id="sortedList"> | |
${state.theList.map(function (item) { | |
return choo.view`<li data-id="${item}">${item}</li>` |
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
console.log('Welcome to connect4!', "\n"); | |
var connect4Obj = { | |
board: new Array(), // this will be a two dimensional array | |
boardWidth : 7, | |
boardHeight : 5, | |
player1Piece : 'X', | |
player2Piece : 'O', | |
requiredToWin: 4, |
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
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
const choo = require('choo') | |
const app = choo() | |
const doSomething = (action, state, send) => { | |
console.log('action=', action); | |
console.log('state=', state); |
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
const choo = require('choo') | |
const app = choo() | |
app.model({ | |
state: { title: 'Set the title' }, | |
reducers: { | |
update: (action, state) => ({ title: action.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
;;; package -- Configuring emacs for React editing | |
;;; Last update: 11/15/2016. By Will Kessler | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; | |
;; Set up melpa. | |
;; cf: http://melpa.org/#/getting-started | |
;; | |
(require 'package) ;; You might already have this line | |
(add-to-list 'package-archives |
OlderNewer