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 * as React from "react"; | |
| interface Payload { | |
| text: string; | |
| timestamp: number; | |
| } | |
| interface ChatProps { | |
| } |
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
| # Create a WebSocket connection to the chat server | |
| ws = new WebSocket 'ws://localhost:8081' | |
| messages = [] | |
| # Add an event listener that will trigger when connection is open | |
| ws.onopen = (event) -> | |
| print 'Connection to chat server is now open' | |
| # Add an event listener that will trigger when connection closes |
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 http and ws modules | |
| const http = require('http'); | |
| const WebSocket = require('ws'); | |
| // Create an http server | |
| const server = new http.createServer(); | |
| // Create a WebSocket server by wrapping the http server | |
| const wss = new WebSocket.Server({ server }); |
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
| new Model | |
| path: './models/plate.obj' | |
| parent: scene | |
| scale: 30 | |
| y: 100 | |
| rotationX:30 | |
| material: new THREE.MeshPhongMaterial | |
| color: 0xffffff | |
| specular: 0xffffff | |
| shininess: 20 |
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
| for i in [0..4] | |
| focusable = new Focusable | |
| parent: homeView.safezone | |
| y: i * 90 + 100 | |
| backgroundColor: null | |
| width: padding * 10 + padding | |
| height: 80 | |
| x: 10 | |
| html: "#{editPlayerMenu[i]}" | |
| style: |
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
| myPromise = new Promise (resolve, reject) -> | |
| Utils.delay 3, () -> | |
| print 'Function Executed after 3 seconds!' | |
| resolve() | |
| myPromise.then () -> | |
| print 'This will be printed as soon as the promise executes the resolve-function' |
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
| {Scene, Light, Model} = require 'form' | |
| # Create a scene | |
| scene = new Scene | |
| width: Screen.width | |
| height: Screen.height | |
| camera: | |
| orbitControls: true # Enables orbit controls | |
| enableRotate: true # Enables click & drag orbiting |
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
| {Scene, Light, Model} = require 'form' | |
| # Create a scene | |
| scene = new Scene | |
| width: Screen.width | |
| height: Screen.height | |
| # Create a light | |
| new Light | |
| parent: scene |
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
| {Scene, Light, Model} = require 'form' | |
| # Create a scene | |
| scene = new Scene | |
| width: Screen.width | |
| height: Screen.height | |
| # Create a light | |
| new Light | |
| parent: scene |
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
| app.on 'change:focusedElement', (focusable) -> | |
| if focusable == focusableIWantToAnimate | |
| focusable.animate | |
| ... |
NewerOlder