This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
#Source: https://newspaint.wordpress.com/2014/08/18/filtering-easylist-for-hosts-file-style-adblock/ | |
use strict; | |
my %hosts = (); | |
while ( <> ) { | |
if ( $_ =~ m/^\|\|([a-z][a-z0-9-_.]+\.([a-z]{2,3}))\^\s*$/ ) { | |
$hosts{$1} = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google Ad Highlighter | |
// @namespace https://gist.github.com/nilayk/ca6dd5b15f958efb5d2e20c3caca3a9f/ | |
// @version 1.1 | |
// @description Highlight Google Ads in search results | |
// @author Nilay Khandelwal | |
// @include *google.com/search* | |
// @downloadURL https://gist.githubusercontent.com/nilayk/ca6dd5b15f958efb5d2e20c3caca3a9f/raw/Google%2520Ad%2520Highlighter.user.js | |
// @grant GM_addStyle | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var showPosition = function(position) { | |
var times = SunCalc.getTimes(new Date(), position.coords.latitude, position.coords.longitude); | |
console.log("Today evening's golden hour is from: " + times.goldenHour.toLocaleTimeString() + " to " + times.sunset.toLocaleTimeString()); | |
}; | |
var s = document.createElement("script"); | |
s.type = "text/javascript"; | |
s.onload = function() { | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(showPosition); |