Skip to content

Instantly share code, notes, and snippets.

View Jason-LJQ's full-sized avatar

Jason Liao Jason-LJQ

  • Carnegie Mellon University
  • Pittsburgh, PA
  • LinkedIn in/jasonljq
View GitHub Profile
@L422Y
L422Y / Mass cancel Amazon Subscribe and Save.md
Last active June 27, 2026 14:40
Mass cancel Amazon Subscribe and Save
  1. Open your subscriptions page:
https://www.amazon.com/auto-deliveries/subscriptionList?shipId=mpkmmwlssrkq&ref_=mys_nav_op_D
  1. Paste into devtools console
  2. Wait a few moments, and then refresh/repeat for any additional pages
  3. Confirm by checking to see if you've received cancellation emails
@genffy
genffy / remove-gray.js
Last active December 3, 2022 06:43
remove-gray PR wellcome
// ==UserScript==
// @name remove-gray
// @namespace http://tampermonkey.net/
// @version 0.1
// @description remove gray theme
// @author You
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant GM_addStyle
// ==/UserScript==
@Gustavo-Kuze
Gustavo-Kuze / force-ctrl-c-v.md
Last active June 8, 2026 17:07
Enable copy and paste in a webpage from the browser console
javascript:(function(){
  allowCopyAndPaste = function(e){
  e.stopImmediatePropagation();
  return true;
  };
  document.addEventListener('copy', allowCopyAndPaste, true);
  document.addEventListener('paste', allowCopyAndPaste, true);
  document.addEventListener('onpaste', allowCopyAndPaste, true);
})(); 
@pavlov99
pavlov99 / haversine.scala
Created December 19, 2016 07:52
Spherical distance calcualtion based on latitude and longitude with Apache Spark
// Based on following links:
// http://andrew.hedges.name/experiments/haversine/
// http://www.movable-type.co.uk/scripts/latlong.html
df
.withColumn("a", pow(sin(toRadians($"destination_latitude" - $"origin_latitude") / 2), 2) + cos(toRadians($"origin_latitude")) * cos(toRadians($"destination_latitude")) * pow(sin(toRadians($"destination_longitude" - $"origin_longitude") / 2), 2))
.withColumn("distance", atan2(sqrt($"a"), sqrt(-$"a" + 1)) * 2 * 6371)
>>>
+--------------+-------------------+-------------+----------------+---------------+----------------+--------------------+---------------------+--------------------+------------------+
|origin_airport|destination_airport| origin_city|destination_city|origin_latitude|origin_longitude|destination_latitude|destination_longitude| a| distance|