ssh root@YOURDOMAIN
adduser deploy
visudo # Add deploy ALL=(ALL) ALL
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
function Refresher (opts) { | |
if (! (this instanceof arguments.callee)) { | |
return new arguments.callee(arguments); | |
} | |
var self = this; | |
self.settings = { | |
interval: opts.interval || 5*60*1000 | |
}; |
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
points_to_svg_string: function(points) { | |
if (!points[0]) { | |
return ""; | |
} | |
var svg_string = "M" + points[0][0] + " " + points[0][1]; | |
for (var i = 1; i < points.length; i++) { | |
var x = points[i][0], | |
y = points[i][1]; | |
svg_string = svg_string + "L" + x + " " + y; | |
} |
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
#/public/js/script.coffee | |
# Let's create an empty object to store our stuff | |
TC = {} | |
# A method to setup our socket | |
TC.init_socket = -> | |
@socket = new io.Socket "localhost", port: 3010 | |
@socket.on "message", @handle_message | |
@socket.connect() |
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
<!-- /public/index.html --> | |
... | |
<script src="/js/libs/jquery-1.5.2.js"></script> | |
<script src="/socket.io/socket.io.js"></script> | |
<!-- New Friends --> | |
<script src="/js/libs/processing-1.1.0.js"></script> | |
<script src="/js/libs/soundmanager2.js"></script> | |
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
class Time | |
def to_half_hour_start | |
if self.min >= 30 | |
self.to_hour_end - 30.minutes | |
else | |
self.to_hour_start | |
end | |
end | |
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
vget: (name) -> | |
if @has name | |
@get name | |
else | |
@[name]() |
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
old_render = @render | |
@render = => | |
t0 = new Date() | |
ret = old_render() | |
t1 = new Date() | |
t = t1 - t0 | |
window.benches or= {} | |
window.benches.rows or= [] | |
window.benches.rows.push t |
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
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough [email protected] | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
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
# ViewLoader will load a list of partial views/templates from a json list (default is '/views/view_list.json'). Each view will be appended to the page in <script type="text/template"> tags with the id of the filename. One they have all been appended, the callback will be called. | |
class window.ViewLoader | |
constructor: (opts={}, @callback) -> | |
if (typeof opts) == "function" | |
@callback = opts | |
opts = {} | |
else | |
@callback = opts.success | |
@opts = opts |
OlderNewer