Skip to content

Instantly share code, notes, and snippets.

maxov /
Last active Jan 1, 2016
Monads in LiveScript

This is an implementation of monads in a way that is pretty for LiveScript(given its amazing syntactic structures). This was originally a comment for LiveScript #426.

maxov /
Last active Aug 29, 2015
An explanation of how to share variables between Gulp and Grunt

Sharing variables between Gulp and Grunt

Gulp, while being a great build system, isn't perfect. Its plugin system is immature and not as full-featured as Grunt. I created gulp-grunt as a remedy for this problem, making it possible to import tasks from Grunt to gulp.

However, sometimes you want to use variables in both files. How? Well, use an accessory file to define all your variables, and import it from both.

maxov / once.js
Created Jun 10, 2014
function that makes a function that only calls once
View once.js
// do cb only once
function do_once(cb) {
var has_called = false;
// the function that is returned
return function () {
if(!has_called) {
has_called = true;
maxov /
Last active Aug 29, 2015
A document outlining plans.


In this document I hope to expose a new way of managing nested views and even routing/controllers in Marionette. This is rather opinionated, but hopefully in a good way. It provides a replacement for what are typically called 'controllers', which Marionette and Backbone don't have. In any case, it certainly makes Marionette more opinionated, but it does not in any way restrict users from doing certain things.

maxov / gist:804ed227f979603b3c37
Last active Aug 29, 2015
An example of a simple sponge-based Component-Entity-System.
View gist:804ed227f979603b3c37
package org.spongepowered.api.
import java.util.*;
public class Hello {
public static void main(String[] args) {
EntityComponentSystem ecs = new EntityComponentSystem();
maxov / gist:3d2c7e740fa3db20f97b
Last active Aug 29, 2015
View gist:3d2c7e740fa3db20f97b
// Represents a thing in the game world
interface Body {
int getID();
// Represents a behavior
interface Component {
View gist:0b6cf61c2f6c1ba898db

Commands use-cases

So in thinking through the use-cases of commands w.r.t. Sponge I came uo with an algorithm for dealing with /command word conflicts.

I'm going to gloss over a few details that prepare the data structures in Sponge that hold information about the mapping of "command" to "plugin" off for a moment. I have another idea there... but for the problem scope limited to just de-conflicting:

Imagine each plugin is a node in a BST (binary search tree).

maxov / mcmods.txt
Last active Aug 29, 2015
All MC Mods(in no particular order)
View mcmods.txt
View mcbiomes.txt
Extreme Hills
The End
Frozen Ocean
Frozen River
maxov / aquifer-package-client.js
Last active Aug 29, 2015
Aquifer package format
View aquifer-package-client.js
// a client-side package (nudge nudge wink wink)
"name": "my-name",
"owner": "org-or-user",
"version": "0.5.0",
"paths": {
"artifact": "builds/my-name-*.jar",
"docs": "docs/"
"dependencies": {