Skip to content

Instantly share code, notes, and snippets.

Max Ovsiankin maxov

Block or report user

Report or block maxov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maxov
maxov / README.md
Last active Aug 29, 2015
An explanation of how to share variables between Gulp and Grunt
View README.md

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
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) {
cb.apply(arguments);
has_called = true;
}
}
@maxov
maxov / README.md
Last active Aug 29, 2015
A document outlining plans.
View README.md

Marionette.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
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
maxov / gist:3d2c7e740fa3db20f97b
Last active Aug 29, 2015
Body-Component-System
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
maxov / mcmods.txt
Last active Aug 29, 2015
All MC Mods(in no particular order)
View mcmods.txt
granite
husk
bukkit
sponge
rainbow
spigot
forge
trident
glowstone
vanilla
View mcbiomes.txt
Biomes
====
River
Ocean
Extreme Hills
Nether
The End
Frozen Ocean
Frozen River
@maxov
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": {
View gist:e5d0baa9203be0b96faa
public interface Sender {
String getName()
void say(Message message);
}
public interface Reciever {
You can’t perform that action at this time.