Table of Contents:
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 run(generator) { | |
// Pass in resume for no-wrap function calls | |
var iterator = generator(resume); | |
var data = null, yielded = false; | |
next(); | |
check(); | |
function next(item) { | |
var cont = iterator.next(item).value; |
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 List (map, (::)) | |
import Color (Color, rgb) | |
import Keyboard (arrows) | |
import Signal (Signal, (<~), foldp) | |
import Graphics.Collage (square, circle, move, filled, collage, Form) | |
import Graphics.Element (Element) | |
type alias Vector = { | |
x : Float, | |
y : Float |
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 _ from 'lodash'; | |
import angular from 'angular'; | |
import 'angular-new-router'; | |
import 'oclazyload'; | |
function AppController ( ) { | |
} | |
AppController.$routeConfig = []; |
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 Color (Color, rgb) | |
import Graphics.Collage (..) | |
import Graphics.Element (Element) | |
import List ((::), map) | |
import Signal (Signal, foldp, (<~), sampleOn) | |
import Keyboard (arrows) | |
import Time (millisecond, every) | |
-------------------------- |
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
module FileUtils exposing (..) | |
import Native.FileUtils | |
import Html exposing (..) | |
import Html.Events exposing (..) | |
import Http exposing (Body) | |
import Json.Decode as Json | |
type alias File = |
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
tim@touchsmart:~/Code$ nvm use v0.11.2-generators | |
Now using node v0.11.2-generators | |
tim@touchsmart:~/Code$ node --harmony testgen.js | |
<Buffer 76 61 72 20 66 73 20 3d 20 72 65 71 75 69 72 65 28 27 66 73 27 29 3b 0a 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 46 69 6c 65 28 70 61 74 68 2c 20 65 6e 63 ...> | |
Sleeping for 2000ms... | |
Done |
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
var http = require('http'); | |
var express = require('express'); | |
var router = express.Router(); | |
/* GET users listing. */ | |
router.get('/', function(req, res) { | |
var request = require('request'); | |
var url = req.query.url; |
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
<snippet> | |
<content><![CDATA[import ipdb; ipdb.set_trace()]]></content> | |
<tabTrigger>ipdb</tabTrigger> | |
<scope>source.python</scope> | |
<description>ipdb</description> | |
</snippet> |
#Exploring Entity Component Systems in Elm
Entity-Component-System (or ECS) is a pattern for designing programs that is prevalent in the games industry. This pattern consists of three simple parts:
- Entity : A uniquely identifiable object that may contain any number of components
- Component : A property usually representing the raw data of one aspect of the object. (Position is a component, Velocity is a component, Strength is a component, etc...)
- System : A continuous process performing actions on every entity that possesses a component of the same aspect as that system
To understand this, let us try to make a simple example: Boxes that move in space:
OlderNewer