Skip to content

Instantly share code, notes, and snippets.

View dominion.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by Isaac Holmlund ( -->
<xs:schema xmlns:xs="">
<xs:element name="type" nillable="false">
<xs:restriction base="xs:string">
<xs:enumeration value="action"/>
<xs:enumeration value="action-attack"/>
<xs:enumeration value="action-duration"/>
<xs:enumeration value="action-reaction"/>
View Class.js
/* Simple JavaScript Inheritance for ES 5.1 ( includes polyfill for IE < 9 )
* based on
* (inspired by base2 and Prototype)
* MIT Licensed.
(function (global) {
"use strict";
if (!Object.create) {
Object.create = (function () {
rmkane /
Last active Aug 29, 2015
Timer and TimerTask written using the MooTools framework.

#MooTools Timer Example

Below is a code snippet that uses the Timer and TimerTask classes.


function print(id, value) {
    document.getElementById(id).innerHTML = value;
View GradientGeneratorLib.js
function decToHex(dec) {
return (function (hex) {
return hex.length == 1 ? "0" + hex : hex;
function hexToRgb(hex) {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
if (result) {
return {
rmkane /
Last active Aug 29, 2015
A URL parser written in JavaScript

URL Parser

The following module handles parsing a URL in JavaScript. If this script is run outside of a browser, where the DOM is inaccessible, a regular expression will be executed to parse the provided URL.







<script src=""></script>

<div ng-app="countryApp">
  <div ng-controller="CountryCtrl">
rmkane /
Created Jul 10, 2015
Java: Bresenham's algorithm
package com.stackoverflow.utils;
import java.util.List;
public class CollectionUtils {
public static <T> String mapJoin(List<T> list) {
rmkane /
Last active Oct 9, 2015
ModBot Documentation
rmkane /
Last active Nov 20, 2015
JSONView SublimeText Theme

Custom SublimeText theme for the JSONView browser plugin.

Paste the sublime-text.css stylesheet rules into the theme editor.

Tip: Themes can be configure under the options in the extensions page in the browser.

rmkane /
Last active Oct 8, 2015
Dynamic Multi-Sort

A sorting helper to sort an array of objects using multiple sorting properties. Property scoping is supported.

Your sorters can be simple property strings, or sorter objects.

This gist can be viewed at Alternatively, you can view this example over at JSFiddle.