Skip to content

Instantly share code, notes, and snippets.

View yask123's full-sized avatar
👨‍💻

Yask Srivastava yask123

👨‍💻
View GitHub Profile
@yask123
yask123 / whatsapp_sendMSG.js
Created January 24, 2015 17:08
Send messages on whatsapp by Javascript
document.getElementsByClassName("input")[1].innerHTML="This message was written via JS script! "; // Fills the text box message
var input = document.getElementsByClassName("icon btn-icon icon-send");//Grabs the send button
input[0].click();// Clicks the send button
var img_dom = document.getElementsByClassName('image-thumb-body');
var links = [];
for (var i = 0; i< img_dom.length;i++){
links.push(img_dom[i].src);
}
function downloadAll(urls) {
var link = document.createElement('a');
var img_dom = document.getElementsByClassName('image-thumb-body');
var links = [];
for (var i = 0; i< img_dom.length;i++){
links.push(img_dom[i].src);
}
function downloadAll(urls) {
var link = document.createElement('a');
a = document.getElementsByClassName('uiTextareaNoResize uiTextareaAutogrow _1rv');
for(var i = 0;i<10;i++)
{
a[0].value='Hey!';
b = document.getElementById("u_jsonp_6_6");// The id name will probably be different from you, check it out from dev-console.
b.click();
}
function dispatch(target, eventType, char) {
var evt = document.createEvent("TextEvent");
evt.initTextEvent (eventType, true, true, window, char, 0, "en-US");
target.focus();
target.dispatchEvent(evt);
}
dispatch(document.querySelector("#compose-input div"), "textInput", "hello!");
@yask123
yask123 / sandibooks.txt
Created June 15, 2018 21:18 — forked from jonathankwok/sandibooks.txt
sandi's recommended references
(I've amended it to use Amazon.ca)
Things to Read:
Refactoring
Martin Fowler: Refactoring, Improving the Design of Existing Code
https://www.amazon.ca/Refactoring-Improving-Existing-Addison-Wesley-Technology-ebook/dp/B007WTFWJ6
Jay Fields: Refactoring, Ruby Edition
https://www.amazon.ca/Refactoring-Ruby-Addison-Wesley-Professional-ebook/dp/B002TIOYWG/
source ~/.config/nvim/plugins.vim
filetype plugin indent on " load filetype-specific indent files
syntax enable " enable syntax processing
set ai " Auto indent
set backspace=2
set cursorline " highlight current line
set encoding=utf8
set expandtab " tabs are spaces"
filetype plugin indent on " load filetype-specific indent files
syntax enable " enable syntax processing
set nohlsearch
set ai " Auto indent
set backspace=2
set cursorline " highlight current line
set encoding=utf8
set expandtab " tabs are spaces"
set foldenable " enable folding
import requests
cookies = {
'hackerrankx_mixpanel_token': '272ea07a-d083-46b9-959b-87ae1fc57b2c',
'hackerrank_mixpanel_token': '8540fec9-da7b-477f-8ef3-843b64c89215',
'optimizelyEndUserId': 'oeu1472732675307r0.5341516336263654',
'codeagon_crp': '*nil*',
'interstate_v2_efa8dff896d3b51999c6e1eae8719e46b2a36441': '%7B%22user_identifier%22%3A%22289b727b-fb40-4d2b-b8bc-b34b542894c1%22%2C%22last_updated%22%3A1472732677134%2C%22utm_campaign%22%3Anull%2C%22utm_source%22%3Anull%2C%22utm_medium%22%3Anull%2C%22utm_term%22%3Anull%2C%22utm_content%22%3Anull%2C%22last_visit%22%3A1474147499833%7D',
'enableIntellisenseUserPref': 'true',
'booking-com-passions-hacked-frontend_crp': '*nil*',
from collections import deque
class Solution:
# @param N : integer
# @param M : integer
# @param x1 : integer
# @param y1 : integer
# @param x2 : integer
# @param y2 : integer
# @return an integer