Skip to content

Instantly share code, notes, and snippets.

View nilayk's full-sized avatar

Nilay Khandelwal nilayk

  • AdSupply Inc.
  • Los Angeles, CA
View GitHub Profile
@nilayk
nilayk / easylist.pl
Created May 14, 2018 20:50 — forked from g3rhard/easylist.pl
Adding EasyList subscriptions for PiHole project
#!/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;
}
@nilayk
nilayk / Google Ad Highlighter.user.js
Last active March 24, 2023 20:07
Tampermonkey Script - Google Ad Highlighter
// ==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==
@nilayk
nilayk / evening_golden_hours.js
Created May 4, 2020 01:27
Today evening's golden hour times in console
(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);