Skip to content

Instantly share code, notes, and snippets.

Avatar

Martijn van der Ven Zegnat

View GitHub Profile
@Zegnat
Zegnat / gist:9482902
Created Mar 11, 2014
Blocklist (Adblock Plus filter syntax)
View gist:9482902
! http://blog.ghost.org/viewcounter/
*/view.gif?page=/*$image
View defaults.css
* {
box-sizing: inherit;
overflow: inherit;
}
html {
box-sizing: border-box;
overflow: auto;
}
View README.md
  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.

View fix.js
"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 Sep 15, 2014
Somewhat complete SASS mixin for font-feature-settings.
View README.md

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 Aug 29, 2015
Generate a list of applications installed through Steam.
View steam.html_build.js
'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) {
View rel-noreferrer-polyfill.js
(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 Aug 29, 2015
Week 1 - Programming Assignment
View ciphertext-generator.js
/*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 Aug 29, 2015
Userscript: Generate a playlist link for Twitch Tools’s Download Videos feature, for easy playing of video source files in your media player.
View TwitchToolsM3UGenerator.user.js
// ==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 Jan 23, 2015
Userscript: removes all the IndieRoyale bundles (royals) you haven’t bought from your collection page.
View IndieRoyaleHiderOfMisses.user.js
// ==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==