Skip to content

Instantly share code, notes, and snippets.

View Zegnat's full-sized avatar

Martijn van der Ven Zegnat

View GitHub Profile
@Zegnat
Zegnat / gist:9482902
Created March 11, 2014 10:11
Blocklist (Adblock Plus filter syntax)
! http://blog.ghost.org/viewcounter/
*/view.gif?page=/*$image
* {
box-sizing: inherit;
overflow: inherit;
}
html {
box-sizing: border-box;
overflow: auto;
}
  1. Add to the root folder of your prism-break copy.
  2. Run by writing node copystubs.js in the terminal.
  3. Watch the output.

The output will tell you 2 things:

  1. If it has added projects from en-projects.json to any other localisation file.
  2. If any localisation file contained projects of which the slugs did not excist in en-projects.json.

The warnings given by step 2 are only warnings, you will have to resolve them yourself. This script does never remove content from a file, it only adds.

"use strict";
var db = './source/db',
fs = require('fs');
fs.readdirSync(db).forEach(function (file) {
if (file.match(/^\w\w(-\w+)?-projects\.json$/)) {
fs.writeFileSync(db + '/' + file, JSON.stringify(JSON.parse(fs.readFileSync(db + '/' + file, 'utf8')), null, ' ') + "\n");
}
});
@Zegnat
Zegnat / README.md
Created September 15, 2014 19:04
Somewhat complete SASS mixin for font-feature-settings.

LibSass compatible.

Pass any valid comma separated list of feature tag–value pairs, always in the form of "tag" value where value is 0 or 1. These will be mixed in with the defaults (as in $font-feature-defaults).

@Zegnat
Zegnat / steam.html_build.js
Last active August 29, 2015 14:07
Generate a list of applications installed through Steam.
'use strict';
var fs = require('fs'), path = require('path'), tilde = process.env.HOME,
SteamApps = tilde + '/Library/Application Support/Steam/SteamApps',
print = function (string) { return process.stdout.write(string + "\n"); },
games = fs
.readdirSync(SteamApps)
.filter(function(file) {
return path.extname(file) === '.acf';
})
.map(function(file) {
(function(links){
for (
var linkCount = links.length, i = 0;
i < linkCount;
i++
) if ((' ' + (links[i].getAttribute('rel') || '').replace(/[\s]/g, ' ') + ' ').indexOf(' noreferrer ') >= 0)
links[i].href = 'data:text/html;base64,' + btoa('<!doctype html><meta http-equiv="refresh" content="0;URL=\'' + encodeURI(links[i].href) + '\'">');
})(document.links);
@Zegnat
Zegnat / ciphertext-generator.js
Last active August 29, 2015 14:13
Week 1 - Programming Assignment
/*jslint node: true, bitwise: true */
"use strict";
// Polyfilling-ish String#encode from Python.
String.prototype.encode = function () {
var out = '', i, l = this.length;
for (i = 0; i < l; i += 1) {
out += ('00' + this.charCodeAt(i).toString(16)).slice(-2);
}
return out;
@Zegnat
Zegnat / TwitchToolsM3UGenerator.user.js
Last active August 29, 2015 14:13
Userscript: Generate a playlist link for Twitch Tools’s Download Videos feature, for easy playing of video source files in your media player.
// ==UserScript==
// @name Twitch Tools Playlist Generator
// @namespace http://zegnat.net/
// @version 2.0
// @description Generate a playlist link for Twitch Tools’s Download Videos feature, for easy playing of video source files in your media player.
// @author Martijn van der Ven
// @license MIT <http://opensource.org/licenses/MIT>
// @match https://twitchtools.com/video-download
// @grant none
// @noframes
@Zegnat
Zegnat / IndieRoyaleHiderOfMisses.user.js
Created January 23, 2015 12:57
Userscript: removes all the IndieRoyale bundles (royals) you haven’t bought from your collection page.
// ==UserScript==
// @name IndieRoyale Hider of Misses
// @namespace http://zegnat.net/
// @version 0.1
// @description Removes all the bundles you haven’t bought from your collection page.
// @author Martijn van der Ven
// @license MIT <http://opensource.org/licenses/MIT>
// @match http://www.indieroyale.com/collection
// @grant none
// ==/UserScript==