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
import Data.IORef | |
import qualified Data.Map as M | |
import Control.Monad(forever) | |
prompt msg = putStr msg >> getLine | |
main = do | |
ref <- newIORef M.empty | |
forever $ do |
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
function Person(name) { | |
this.name = name; | |
this.greet = function() { | |
console.log('Hello ' + this.name); | |
} | |
this.setName = function(name) { | |
this.name = name; | |
} |
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
* { | |
margin: 0; | |
padding: 0; | |
} | |
body { | |
margin: 30px auto; | |
width: 450px; | |
background-color: #efefef; | |
color: #35a; |
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
import ChildElement from './my-element/components/child-element' | |
// registerElement exists on any DOM element which provides namespacing | |
document.body.registerElement('my-element', Blink); | |
class Blink extends HTMLElement { | |
constructor() { | |
this.addEventListener('click', this.win); | |
// This is namespaced inside of my-element because that is where it is registered. |