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
// This approach uses: | |
// - Remix's Express Adapter | |
// - An external Socket.io server on port 3050 | |
// - http-proxy-middleware | |
// | |
// install http-proxy-middleware and apply these lines to `server/index.js`: | |
// | |
const { createProxyMiddleware } = require("http-proxy-middleware"); | |
// Add the middleware before remix's catch-all '*' route |
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
//============================================================================= | |
// Original | |
//============================================================================= | |
var scrKeys = Object.keys(source) | |
return collection.filter(obj => srcKeys.map(key => obj[key] === souce[key]) | |
.map(key => obj[key] === souce[key]). | |
reduce((a, b) => a && b | |
) | |
) |
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
/* | |
handlers: { | |
start(time) {}, | |
stop(time) {}, | |
schedule(from, to, currentTime) {} | |
} | |
context: AudioContext | |
*/ | |
const createScheduler = handlers => context => { | |
let lastSchedule = context.currentTime |
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 express = require('express') | |
const bodyParser = require('body-parser') | |
const uuidv4 = require('uuid/v4') | |
const app = express() | |
const images = {} | |
// This is middleware that lets you get the post body in your endpoint handlers below | |
app.use(bodyParser.json()) |
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
var Core = artifacts.require('Core') | |
var Contract2 = artifacts.require('Contract2') | |
var Contract1 = artifacts.require('Contract1') | |
module.exports = async function (deployer) { | |
deployer.deploy(Contract2) | |
deployer.deploy(Core).then(function () { | |
deployer.deploy(Contract1, Core.address, 250) | |
}) | |
} |
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
subscription { | |
Game(filter: { | |
node: { | |
id: "cj5pmeixz2n8d0187a67a51jo" | |
} | |
}) { | |
mutation | |
updatedFields | |
node { | |
started |
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
import handle from './handle' | |
document.handlers = handle(document) | |
export default { | |
bind(el, binding, {context: {_uid: id}}) { | |
el.handlers = handle(el) | |
el.handlers.mousedown = downHandler | |
// Namespaced handler |
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 mutations = { | |
SET_SELECTED(state, newSelectedThing) { | |
state.item = newSelectedThing | |
Vue.set(state, 'item', newSelectedThing) | |
}, | |
UPDATE_SELECTED(state, {type, name, value}) { | |
if (!state.item) throw new Error(`No item selected while trying to update`) | |
if (!state.item[type]) throw new Error(`Missing property type: ${type}`) | |
// If no name given update the type, else update type.name |
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
<html> | |
<head> | |
<!-- css, page title goes in here--> | |
</head> | |
<body> | |
<center> | |
<img id="sadface" src="http://balance3e.com/Images/sad.gif"> | |
<br> | |
<button onclick="Changeimg(http://balance3e.com/Images/happy.gif);">Smile</button> | |
</center> |
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
console.log('Seems correct!'); |
NewerOlder