Skip to content

Instantly share code, notes, and snippets.

// ==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 January 6, 2017 04:34 — forked from kylefox/liquid-mode.js
Liquid syntax highlighting for CodeMirror.
/*
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 {
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 / calendar.tpl
Created September 19, 2013 21:56
An example template of future and past entries by month
<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 September 19, 2013 21:49
Calendar extension for organizing entries into past and future by month
// 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 December 23, 2015 11:39
A Webpop extension for rendering entries that occurred in the past.
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 September 19, 2013 20:58
An calendar extension for Webpop for sorting entries that occur in the future into months.
// 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"},
// 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 December 17, 2015 01:49
Standard oupput for a picture fill markup with four breakpoints,
<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
@ruemic
ruemic / picture.coffee
Last active December 17, 2015 01:49
A simple responsive image extension for Webpop that abstracts picture markup into a single tag and serves dynamically resized and cached images via CDN.
# This generates markup for https://github.com/scottjehl/picturefill
# Customize this to suit your responsive image needs
markupForImage = (image, options) ->
resize = options.resize
width = options.width
height = options.height
output =
'<div data-picture data-alt="' + image.alt + '">' +