Sometimes you'll have objects that manage state along with event handling. This happens frequently in MVC apps. Let's start with a messy example:
var Launcher = function(rocket) {
this.rocket = rocket
}
Launcher.prototype.isReady = function() {
| /* passable motion blur effect using frame blending | |
| * basically move your 'draw()' into 'sample()', time runs from 0 to 1 | |
| * by dave | |
| * http://beesandbombs.tumblr.com | |
| */ | |
| int samplesPerFrame = 32; // more is better but slower. 32 is enough probably | |
| int numFrames = 48; | |
| float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here | |
| int[][] result; |
| void setup() { | |
| size(500, 500); | |
| noFill(); | |
| strokeWeight(3); | |
| strokeJoin(BEVEL); | |
| } | |
| float th1, th2, r, x, y, t; | |
| int N = 16; |
| var Pusher = require('pusher'), | |
| os = require('os'), | |
| express = require('express'), | |
| app = express(), | |
| ch = 'stats'; | |
| var pusher = new Pusher({ | |
| appId: process.env.PUSHER_APP_ID, | |
| key: process.env.PUSHER_KEY, | |
| secret: process.env.PUSHER_SECRET |
| From the chat: | |
| Vijay Velagapudi 12:16 PM | |
| no problem | |
| To list all available commands enter "/?". | |
| John Elliott 12:23 PM | |
| https://dl.dropboxusercontent.com/u/23241016/startup%20engineering%20public/Lecture-all.pdf - Lecture Notes in one file on Dropbox | |
| Nghia Hoang 12:23 PM |
| http://www.html5rocks.com/en/tutorials/es7/observe/ | |
| http://ng-learn.org/2014/03/AngularJS-2-Status-Preview/ | |
| http://eisenbergeffect.bluespire.com/all-about-angular-2-0/ | |
| http://www.w3.org/wiki/WebComponents/ | |
| https://docs.google.com/document/d/11YUzC-1d0V1-Q3V0fQ7KSit97HnZoKVygDxpWzEYW0U/edit | |
| https://speakerdeck.com/rauschma/ecmascript-6-whats-next-for-javascript-august-2014 | |
| http://pascalprecht.github.io/2014/10/25/integrating-web-components-with-angularjs/ | |
| https://docs.google.com/document/d/1kpuR512G1b0D8egl9245OHaG0cFh0ST0ekhD_g8sxtI/edit#heading=h.xgjl2srtytjt | |
| https://docs.google.com/presentation/d/1Gv-dvU-yy6WY7SiNJ9QRo9XayPS6N2jtgWezdRpoI04/present?slide=id.g108668b30_040 | |
| http://code.tutsplus.com/tutorials/using-polymer-to-create-web-components--cms-20475 |
| // AtScript | |
| import {Component} from 'angular'; | |
| import {Server} from './server'; | |
| @Component({selector: 'foo'}) | |
| export class MyComponent { | |
| constructor(server:Server) { | |
| this.server = server; | |
| } | |
| } |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| // Style the find results | |
| atom-text-editor::shadow .highlight.find-result .region { | |
| background: rgb(163,163,0); | |
| transition: background-color 0.2s, border-color 0.2s; | |
| } | |
| atom-text-editor::shadow .highlight.current-result .region, | |
| atom-text-editor::shadow .highlight.current-result ~ .highlight.selection .region { | |
| background: orange; | |
| border-color: red; | |
| } |
| passwd | |
| systemctl enable sshd.service | |
| systemctl start sshd.service | |
| parted -s /dev/sda mklabel gpt | |
| parted -s /dev/sda mkpart "primary" "fat16" "50MB" "60MB" | |
| parted -s /dev/sda mkpart "primary" "ext4" "1%" "99%" | |
| parted -s /dev/sda set 1 bios_grub on | |
| mkfs.ext4 /dev/sda2 |