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 | |
cruder = require("../lib/cruder"), | |
db = require("../lib/db"). MySQLConnection; | |
var c = new cruder.Cruder(db.connection, "locations", | |
["*title", "*address", "lat", "lng", "*url", "list_url", "map_url", "live_url" ]); | |
var app = express(); // app is an express app |
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
# nvidia-xconfig: X configuration file generated by nvidia-xconfig | |
# nvidia-xconfig: version 256.35 ([email protected]) Wed Jun 16 19:15:05 PDT 2010 | |
# nvidia-settings: X configuration file generated by nvidia-settings | |
# nvidia-settings: version 256.35 ([email protected]) Wed Jun 16 19:14:45 PDT 2010 | |
Section "ServerLayout" | |
Identifier "Layout0" | |
Screen 0 "Screen0" 0 0 | |
InputDevice "Keyboard0" "CoreKeyboard" |
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
// app.js | |
// A simple proxying example | |
// | |
// Setup websocket server on port 19000 | |
// Setup proxy on port 9000 to proxy to 19000 | |
// Make a websocket request to 9000 | |
// | |
var WebSocket = require('ws'), | |
WebSocketServer = WebSocket.Server, |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "precise64" | |
config.vm.hostname = "point-serve" |
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
// testq.js | |
// Test Q based functions | |
// | |
var Q = require('q'); | |
var asQ = function(f) { | |
return function(test) { | |
f(test).fin(function() { | |
test.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
<?xml version="1.0"?> | |
<Pipeline version="1.0"> | |
<Filter type="filters.selector"> | |
<Option name="keep"> | |
<Options> | |
<Option name="dimension"> | |
X | |
</Option> | |
<Option name="dimension"> | |
Y |
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
PointCollector.prototype._2dProj = function(p, proj) { | |
proj = proj || (new THREE.Projector()); | |
var ndc = p.clone(); | |
proj.projectVector(ndc, this.fromCamera); | |
return new THREE.Vector3( | |
ndc.x * this.size[0] / 2, ndc.y * this.size[1] / 2, 1.0); | |
}; |
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 join-path | |
"Join path elements together, if any of the path components start with a / | |
the function assumes that the path is being reset to root and will ignore all parts | |
before that" | |
[p & parts] | |
(let [p (if (empty? p) "." p)] | |
(.getPath (reduce #(if (.startsWith %2 "/") | |
(io/file %2) | |
(io/file %1 %2)) (io/file p) parts)))) |
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 map-vals | |
"Maps the values of the map col using f" | |
[f col] | |
(into {} (map (fn [[a b]] [a (f b)]) col))) |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |