Skip to content

Instantly share code, notes, and snippets.

View ScreepsMarketWatch.js
// ==UserScript==
// @name MarketWatch
// @namespace http://tampermonkey.net/
// @version 0.1
// @description adds market transcation data into history description column
// @author taiga
// @match https://screeps.com/a/
// @grant none
// @run-at document-ready
@ruemic
ruemic / liquid-mode.js
Created Jan 6, 2017 — forked from kylefox/liquid-mode.js
Liquid syntax highlighting for CodeMirror.
View liquid-mode.js
/*
This overlay provides a 'liquid' mode to the excellent CodeMirror editor (http://codemirror.net/).
Add something like this to your CSS:
.cm-liquid-tag {
color: #32273f;
background: #ead9ff;
}
.cm-liquid-variable {
View forwardjs-ml-math-lodash.js
const map = require('lodash/map')
const reduce = require('lodash/reduce')
const validateLengths = (a,b,action) => {
if (a.length !== b.length) {
throw Error(`Can\'t ${action} arrays of length ${a.length} and ${b.length}`);
}
}
const arrayMultiply = (arr1, arr2) => {
@ruemic
ruemic / gist:4cb049ef658228e78909
Last active Aug 29, 2015
Notes about the Array.prototype.reduce polyfill
View gist:4cb049ef658228e78909
if (!Array.prototype.reduce) {
Array.prototype.reduce = function(callback /*, initialcurrentValue*/) {
'use strict';
// Check if calling on array
if (this == null) {
throw new TypeError('Array.prototype.reduce called on null or undefined');
}
// Check if callback function is supplied
@ruemic
ruemic / calendar.tpl
Created Sep 19, 2013
An example template of future and past entries by month
View calendar.tpl
<pop:content>
<h4>Upcoming Shows</h4>
<pop:months>
<pop:start format="mmmm" wrap="h4"/>
<hr>
<pop:entries_between start="<pop:start/>" end="<pop:end/>">
<p><pop:date format="dd"/></p>
@ruemic
ruemic / calendar.js
Created Sep 19, 2013
Calendar extension for organizing entries into past and future by month
View calendar.js
// Use <pop:calendar:months> within the scope of entries to generate
// a timeline array of all the months which have entries
exports.months = function() {
if (!section) return null;
var result = site.search({
all: true,
filters: {section: section, date: "future" },
@ruemic
ruemic / gist:6629785
Last active Dec 23, 2015
A Webpop extension for rendering entries that occurred in the past.
View gist:6629785
exports.past_months = function(options) {
if (!section) return null;
var result = site.search({
all: true,
filters: {section: section, date: "past" },
timeline: {date: "month"},
}).timeline;
return result;
@ruemic
ruemic / calendar.js
Created Sep 19, 2013
An calendar extension for Webpop for sorting entries that occur in the future into months.
View calendar.js
// Use <pop:calendar:months> within the scope of entries to generate
// a timeline array of all the months which have entries
exports.months = function(options) {
if (!section) return null;
var result = site.search({
all: true,
filters: {section: section, date: "future" },
timeline: {date: "month"},
View grid-5
// New grid containing medium styles
/* Grid HTML Classes */
.row {
margin-left: auto;
margin-right: auto;
margin-top: 0;
margin-bottom: 0;
max-width: 62.5em;
width: 100%;
*zoom: 1; }
@ruemic
ruemic / picture-fill-hairball
Last active Dec 17, 2015
Standard oupput for a picture fill markup with four breakpoints,
View picture-fill-hairball
<div data-picture="" data-alt="Eagle Perch">
<div data-src="http://c1940652.r52.cf0.rackcdn.com/fit/150/0/516fc9c9896ad857e2001578/2012-08-24-18.31.24.jpg"> </div>
<div data-src="http://c1940652.r52.cf0.rackcdn.com/fit/300/0/516fc9c9896ad857e2001578/2012-08-24-18.31.24.jpg" data-media="(min-device-pixel-ratio: 2.0)"> </div>
<div data-src="http://c1940652.r52.cf0.rackcdn.com/fit/300/0/516fc9c9896ad857e2001578/2012-08-24-18.31.24.jpg" data-media="(min-width: 768px)"> </div>
<div data-src="http://c1940652.r52.cf0.rackcdn.com/fit/600/0/516fc9c9896ad857e2001578/2012-08-24-18.31.24.jpg" data-media="(min-width: 768px) and (min-device-pixel-ratio: 2.0)"> </div>
<div data-src="http://c1940652.r52.cf0.rackcdn.com/fit/450/0/516fc9c9896ad857e2001578/2012-08-24-18.31.24.jpg" data-media="(min-width: 1280px)"> </div>
<div data-src="http://c1940652.r52.cf0.rackcdn.com/fit/900/0/516fc9c9896ad857e2001578/2012-08-24-18.31.24.jpg" data-media="(min-width: 1280px) and (min-device-pixel-ratio: 2.0)"> </div>
<div data-src="http://c1
You can’t perform that action at this time.