This file contains hidden or 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
<profiles> | |
<profile> | |
<id>scalac-prod</id> | |
<activation> | |
<activeByDefault>true</activeByDefault> | |
</activation> | |
<properties> | |
<fsc.once>true</fsc.once> | |
<fsc.compilation>all</fsc.compilation> | |
</properties> |
This file contains hidden or 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 com.example | |
import spray.servlet.Servlet30ConnectorServlet | |
import spray.servlet.Initializer | |
import org.eclipse.jetty.server.Server | |
import org.eclipse.jetty.server.bio.SocketConnector | |
import org.eclipse.jetty.webapp.WebAppContext | |
import org.eclipse.jetty.servlet.ServletContextHandler | |
object JettyServer { |
This file contains hidden or 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
public class RemoteErrorActor extends UntypedActor { | |
@SuppressWarnings("rawtypes") | |
@Override | |
public void onReceive(Object o) throws Exception { | |
if (o instanceof RemoteClientWriteFailed) { | |
RemoteClientWriteFailed fail = (RemoteClientWriteFailed) o; | |
if (fail.getRequest() instanceof Tuple3) { | |
Tuple3 t3 = (Tuple3) fail.getRequest(); | |
if (t3._2() instanceof Some) { |
This file contains hidden or 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
(ns gameapp) | |
(def gamemod | |
"Create a gameapp module within Angular.js" | |
(.module js/angular "gameapp" (array))) | |
(.directive gamemod "gameslist" | |
(fn [] | |
(js-obj | |
"restrict" "E" |
This file contains hidden or 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 ng-app="gameapp"> | |
<head> | |
<script src="angular.min.js"></script> | |
<script src="cljs-w-directive.js"></script> | |
</head> | |
<body> | |
<h2>Game names</h2> | |
<div ng-controller="gameapp.GameCtrl"> | |
<gameslist games="mygames"/> |
This file contains hidden or 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 PayForm = ({ account, dispatch }) => ( | |
<Form | |
onSubmit={submittedValues => { | |
dispatch({ type: "pay", payee: account, ...submittedValues }); | |
}} | |
> | |
{formApi => ( | |
<form onSubmit={formApi.submitForm} id="pform"> | |
<label htmlFor="password">Password</label> | |
<Text field="password" id="password" /> |
This file contains hidden or 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 contractService = store => next => action => { | |
switch (action.type) { | |
... | |
case "pay": | |
contract | |
.withdraw(action.password, { from: action.payee }) | |
.catch(e => next(failed(e))); | |
... | |
default: | |
next(action); |
This file contains hidden or 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 eventToAction = name => (err, result) => { | |
store.dispatch({ type: "event", name: name, ...result.args }); | |
}; | |
contract.PaidEvent().watch(eventToAction("paid")); | |
contract.ReclaimedEvent().watch(eventToAction("reclaimed")); | |
contract.Instantiated().watch(eventToAction("created")); | |
contract.KilledStateChange().watch(eventToAction("killed")); |
This file contains hidden or 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 eventAction = (state = {}, action) => { | |
switch (action.type) { | |
... | |
case "event": | |
... | |
switch (action.name) { | |
case "created": | |
if (state.account == action.from) { | |
return { ...state, events: ev, status: "reclaimable" }; | |
} else { |
This file contains hidden or 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
export const Forms = ({ status, killed, account, dispatch }) => { | |
if (killed) return <KillForm />; | |
return ( | |
<div> | |
{status ? <span /> : <CreateForm dispatch={dispatch} account={account} />} | |
{status == "payable" ? ( | |
<PayForm dispatch={dispatch} account={account} /> | |
) : ( | |
<span /> | |
)} |
OlderNewer