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
(defn find-cycle | |
"finds a single cycle in the parents | |
starting at the seed index" | |
[a b seed] | |
(loop [coll (mapv vector a b) | |
cyl #{} | |
cur (get-in coll [seed 0])] | |
(let [idx (first (keep-indexed #(if (= (first %2) cur) %1) coll))] | |
(if (nil? idx) | |
(vec cyl) |
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
/* | |
Static Site Generator | |
Author: Cody Shepp 6/27/2014 | |
License: MIT | |
The only outside dependency is mustache (npm install mustache) | |
The basic folder structure I used is as follows: | |
/ |
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
<!doctype html> | |
<head> | |
<title>controller</title> | |
<!--<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />--> | |
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<!--<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>--> | |
<script src="socket.io/socket.io.js"></script> | |
<script src="cordova-2.0.0.js"></script> | |
<script> | |
var transmit = false; |
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
socket.on('disconnect', function(socket){ | |
socket.get('room', function(err, room){ | |
socket.get('nick', function(err, nick){ | |
socket.broadcast.to(room).emit('client-left', nick); | |
}); | |
}); | |
}); |
NewerOlder