Skip to content

Instantly share code, notes, and snippets.

var links = document.getElementsByTagName('a');
var replacements = 0;
for (var i = 0; i < links.length; i++) {
if (links[i].href.match(/^(http(s|):\/\/|)(www\.|)kickass\.to/i)) {
replacements += 1;
links[i].href = links[i].href.toLowerCase().replace('kickass.to', 'katproxy.com');
}
}
console.log('Replaced', replacements, 'KickAss links');
@BenjaminRH
BenjaminRH / README.md
Created April 2, 2017 17:59 — forked from csswizardry/README.md
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vsp **/*<partial file name><Tab>
The Gist of It
@BenjaminRH
BenjaminRH / gist:8577549
Created January 23, 2014 12:07
General
The General Gist
// ==UserScript==
// @id 987654321
// @name Kickasstorrents
// @version 1.0
// @namespace
// @author
// @description
// @run-at document-end
// @match http://*.kickass.to/*
// @match http://*.kat.ph/*
// ==UserScript==
// @id 987654321
// @name KickAss Torrents Proxify
// @version 1.0
// @description Redirects you to a KickAss Torrents proxy
// @run-at document-start
// @match *.kickass.to/*
// @match *.kat.ph/*
// ==/UserScript==
Meteor.Router.add({
'/': {
to: 'index',
and: function () {
Session.set('genre', null);
}
}, // site index
'/:action/:action2/:action3': function (action, action2, action3) {
var genreSession = null,
@BenjaminRH
BenjaminRH / queue.coffee
Last active December 21, 2015 14:18 — forked from svasva/queue.coffee
@Queue = new Meteor.Collection 'queue'
Meteor.startup ->
Meteor._processQueue = ->
if Meteor._queueProcessing ||= false
Meteor.setTimeout Meteor._processQueue, 100
return
Meteor._queueProcessing = true
qsize = Meteor._queue.length
qdone = 0
@BenjaminRH
BenjaminRH / gist:6275907
Created August 20, 2013 00:50
Demonstrating managing a user online status with the event-hooks package
// server
Hooks.onLoggedIn = function (userId) {
Meteor.users.update({_id: userId}, {set: {'profile.status': 'online'}});
}
Hooks.onLoggedOut = function (userId) {
Meteor.users.update({_id: userId}, {set: {'profile.status': 'offline'}});
}
@BenjaminRH
BenjaminRH / gist:5759369
Created June 11, 2013 18:19
Demonstrating subscribing to documents in a collection based on search-terms in Meteor.
// CLIENT
Session.setDefault('search-terms', null); // They haven't searched for anything initially
Deps.autorun(function () {
// This will reactively update the subscription when the value of the search-terms session variable changes
Meteor.subscribe('foobar', Session.get('search-terms'));
});
// SERVER
Meteor.publish('foobar', function (searchTerms) {