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 { Component, createSignal, For, JSX } from "solid-js"; | |
// | |
// Types | |
// | |
type Mark = "x" | "o"; | |
type Coord = `${number},${number}`; |
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
[ | |
{ | |
"key": "cmd+r cmd+r", | |
"command": "workbench.action.tasks.runTask", | |
"args": "Reload Chrome" | |
} | |
] |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Handlebars: Helper vs Partial</title> | |
</head> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js"></script> | |
<script id="template" type="x-template/handlebars"> | |
<p>Hey there my name is {{name}}</p> |
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> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<div id="output_h"></div> | |
<div id="output_v"></div> | |
<script src="virtual-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js"></script> |
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 Component = React.createClass({ | |
contextTypes: { | |
router: React.PropTypes.func | |
}, | |
propTypes: { | |
isCool: React.PropTypes.bool | |
}, | |
getDefaultProps() { | |
return { | |
isCool: false |
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
set nocompatible | |
filetype off | |
filetype plugin indent off | |
" ----------------------------------------------------------------------------- | |
" Plugins | |
" ----------------------------------------------------------------------------- | |
" Set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/vundle.vim/ |
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 F2Class = function() { | |
return { | |
emit: function(name, data) { | |
console.log("Safe and sound"); | |
} | |
}; | |
}; |
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
/* | |
Summary | |
In this example, each app gets its own instance of F2. Every instance of F2 | |
will share all the same page events. This setup will allow each app to add its | |
own plugins without interfering with the rest of the apps. | |
We'll add internal checks to make sure events are only broadcast to "trusted" | |
apps. This should allow any app to specify any other app on the page | |
*/ |
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
Goals for sandboxing: | |
- Prevent "F2.Events.emit = function() { }" hijacking | |
- Apps can sandbox themselves without the container | |
- Sandboxing is optional | |
- Sandboxed apps can emit global events | |
- Apps can be sandboxed with any app from any domain |
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
// Inside F2 library | |
// -------------------------------------------------------------------------------- | |
// Override "define" to give us the appId inside the plugin | |
var oldDefine = define; | |
define = function(id, deps, fn) { | |
// Append the appId to the dependency | |
if (deps && deps instanceof Array) { | |
for (var i = 0; i < deps.length; i++) { | |
if (deps[i].indexOf('F2Sandbox!') === 0) { |
NewerOlder