Skip to content

Instantly share code, notes, and snippets.

View Yuffster's full-sized avatar
🕳️
ᕕ( ᐛ ) ᕗ

Michelle Steigerwalt Yuffster

🕳️
ᕕ( ᐛ ) ᕗ
View GitHub Profile
+--[ RSA 2048]----+
| |
| |
|E |
|. |
|. S |
| . o. . |
|. +o.+. . |
| =+++.+. |
|+o+++=o=o |
var print_to = (function(to) {
var n = 1, print_n = (function() {
if (n>to) { print_n = false; return; }
console.log(n++);
print_n();
});
print_n();
});
var print_too = (function(to) {
/**
* Main server script for Discord mudlib. Most of the code is still messy from
* Node Knockout.
*
* This file is in charge of all the nitty gritty bits of loading all the
* JavaScript files required to get a World instance running, then opening a
* socket and redirecting input to a Player object within the world.
*
* Most of the file loading logistics lives in the World class, which handles
* determining where to pull files from based on configuration options and
(function() { //Only Discord will end up in the global namespace.
Discord = new Class({
Implements: [Events, Options],
connection: false,
commandHistory: [],
commandIndex: 0,
/**
* INSTALLATION:
*
* All these modules are core modules except for redis. To install that, just
* type 'npm install redis'.
*
* To run, 'node app.js <port number>'.
*
* USAGE:
*
//Foo is in the global namespace. Let's see which closure contents overwrite it.
foo = function() { console.log("FOO"); };
// Defining a named function will never overwrite the global namespace.
(function() {
function foo() { console.log("OH NOES"); }
})();
foo(); //FOO
Eve.scope('.hello-world', function() {
this.listen('div.line', 'click', function(e) {
console.log("You clicked on .hello-world div.line");
});
});
Eve.scope('.hello-world', function() {
this.listen('div.line', 'click', function(e) {
console.log("You clicked on .hello-world div.line");
});
});
Eve.scope('.hello-world', function() {
this.listen('div.line', 'click', function(e) {
console.log("You clicked on .hello-world div.line");
});
});
Eve.register('myAwesomePlugin', function() {
this.listen('a', 'click', function() {
console.log("You clicked on a link within my namespace!");
});
//Since no namespace is provided, this event will be triggered by
//any click events within the scoped namespace.
this.listen('click', function() {
alert("You clicked somewhere within my namespace!");