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
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
*/ | |
var http = require('http'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(function (req, res) { | |
var path = 'video.mp4'; |
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
// api/controllers/AuthController.js | |
var passport = require('passport'); | |
var AuthController = { | |
login: function (req,res) | |
{ | |
res.view(); | |
}, |
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
package fyretail | |
package opengl | |
import java.nio.ByteBuffer | |
import java.nio.ByteOrder | |
import scala.collection.mutable.Buffer | |
import android.opengl.GLES20 | |
import fyretail.Camera | |
import fyretail.Rect | |
import fyretail.Sizeable |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Audio; | |
using Microsoft.Xna.Framework.Content; | |
using Microsoft.Xna.Framework.GamerServices; | |
using Microsoft.Xna.Framework.Graphics; | |
using Microsoft.Xna.Framework.Input; | |
using Microsoft.Xna.Framework.Media; |
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
let player = proc j -> do | |
sx <- keySpeed GLFW.LEFT GLFW.RIGHT 500 -< () | |
let gravity = (0, 9.8) | |
jump <- pure (0, (-100)) . holdFor 0.1 (keyPressed ' ') <|> pure (0, 0) -< sx | |
v <- integral_ (0,0) -< gravity ^+^ jump | |
(dx, dy) <- integralLim_ collision (0,0) -< (v ^+^ (sx, 0), ()) | |
returnA -< renderSprites [Sprite img (realToFrac dx, realToFrac dy) 0] |
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
{-# LANGUAGE OverloadedStrings, TypeFamilies, QuasiQuotes, TemplateHaskell, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, RecordWildCards #-} | |
module Site.Story where | |
import Prelude | |
import Yesod | |
import Yesod.Auth | |
import Model | |
import Control.Concurrent.Chan (Chan, dupChan, writeChan, newChan) | |
import Data.Text (Text) | |
import Data.Map (Map) |
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 Control.Concurrent.Chan (Chan, newChan) | |
import qualified Data.Map as M | |
import Control.Concurrent.STM (TVar, readTVar, writeTVar) | |
type Id = Integer | |
getOrCreateChannel :: (MonadIO m) => Id -> TVar (M.Map Id (Chan a)) -> m (Chan a) | |
getOrCreateChannel cid t = liftIO $ do | |
nchan <- newChan | |
atomically $ do |
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
Glasgow Haskell Compiler, Version 7.6.1, stage 2 booted by GHC version 7.4.1 | |
Using binary package database: /home/scanish/lib/ghc-7.6.1/package.conf.d/package.cache | |
Using package config file: dist/package.conf.inplace | |
wired-in package ghc-prim mapped to ghc-prim-0.3.0.0-4fae45041dab03fbd317982185b6da0d | |
wired-in package integer-gmp mapped to integer-gmp-0.5.0.0-b00b433d848ac9c48e7f9ce9532e0def | |
wired-in package base mapped to base-4.6.0.0-9108e251636b0c8499261c52a7809ea1 | |
wired-in package rts mapped to builtin_rts | |
wired-in package template-haskell mapped to template-haskell-2.8.0.0-081a3c421c0e633e9f90f3703d633ddb | |
wired-in package dph-seq not found. | |
wired-in package dph-par not found. |
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 express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res) { | |
res.send({running:true}); | |
}); | |
var server = app.listen(process.env.app_port || 8080, function() { | |
console.log("Server running on " + server.address().port + " in " + app.settings.env + " mode."); |
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
{ | |
"author": "your name", | |
"name": "app name", | |
"description": "Tutorial app", | |
"version": "0.0.0", | |
"private": true, | |
"homepage": "http://appname.nodester.com", | |
"node": "0.8.1", | |
"main": "server.js", | |
"dependencies": { |