Skip to content

Instantly share code, notes, and snippets.

View theevilhead's full-sized avatar
:octocat:

Girish Patil theevilhead

:octocat:
View GitHub Profile
@theevilhead
theevilhead / gist:7ac2fbc3cda897ebd87dbe9aeac130d6
Last active January 5, 2021 05:21
Easiest way to detect direction of drag
var dragStartX;
var dragStartY;
window.addEventListener("dragstart",function(e){
dragStartX = Math.ceil(e.offsetX/70);
dragStartY = Math.ceil(e.offsetY/70);
})
window.addEventListener("dragend",function(e){
var dropX = Math.abs(dragstartX - e.screenX);
#smooth way to install scikit learn on python 2.6
# Install miniconda from http://conda.pydata.org/miniconda.html
# Now run the script
bash ./location-pf-the-script.sh
#It will install mini conda
# Now run
@theevilhead
theevilhead / mixmatch.gs
Last active September 24, 2019 17:59
Secret santa mixmatch with google sheets and apps script : Use this script following the instructions in the gist to create a Secret santa mix-match and if needed send each user their partner's details Read whole post here @Hashnode https://hashnode.com/post/secret-santa-mix-match-with-google-sheets-and-apps-script-cjptefe1d00rikas2z9joelqa
/** Dummy data
gslondon@yahoo.ca Thomas Bolan  
csilvers@hotmail.com Rafael Ridgley  
north@yahoo.com Shoshana Zarrella  
garyjb@live.com Shavon Cales  
euice@att.net Mirian Fasano  
scitext@att.net Wilfred Patch  
ingolfke@live.com Allan Bankes  
johndo@hotmail.com Edwin Acheson  
gozer@gmail.com Emanuel Oriley  
@theevilhead
theevilhead / amp-email-personalised-newsletter.html
Last active April 29, 2019 05:49
This amp email has personalised posts in newsletters with bookmarking and upvoting options. Which hit an endpoint on action. It also has a unsubscribe/resubscribe button inside the email. All these operations are done without leaving your email.
<!doctype html>
<!-- Either ⚡4email or amp4email is valid -->
<html ⚡4email>
<head>
<!-- REQUIRED -->
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>