Skip to content

Instantly share code, notes, and snippets.

View farooqarahim's full-sized avatar
:octocat:

Farooq A Rahim farooqarahim

:octocat:
View GitHub Profile
@farooqarahim
farooqarahim / geckodriver-install.sh
Created May 30, 2022 04:02 — forked from cgoldberg/geckodriver-install.sh
download and install latest geckodriver for linux or mac (selenium webdriver)
#!/bin/bash
# download and install latest geckodriver for linux or mac.
# required for selenium to drive a firefox browser.
install_dir="/usr/local/bin"
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest)
if [[ $(uname) == "Darwin" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos"))')
elif [[ $(uname) == "Linux" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
@farooqarahim
farooqarahim / 1.js
Created February 11, 2021 20:11 — forked from getify/1.js
creating hard-bound methods on classes
class Foo {
constructor(x) { this.foo = x; }
hello() { console.log(this.foo); }
}
class Bar extends Foo {
constructor(x) { super(x); this.bar = x * 100; }
world() { console.log(this.bar); }
}
@farooqarahim
farooqarahim / README.md
Created October 14, 2020 00:53 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@farooqarahim
farooqarahim / index.js
Created May 27, 2018 22:52
Get list of all users in Telegram channel / supergroup
/*
* MIT License
*
* Copyright (c) 2017-2018 Bannerets <save14@protonmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is