Skip to content

Instantly share code, notes, and snippets.

View hanikhan's full-sized avatar

Hani Khan hanikhan

  • Ex Dream11, Ex BrowserStack
  • Mumbai India
View GitHub Profile
# Editable install with no version control (apache-airflow==1.10.10)
Babel==2.8.0
Flask-Admin==1.5.4
Flask-AppBuilder==2.3.0
Flask-Babel==1.0.0
Flask-Bcrypt==0.7.1
Flask-Caching==1.3.3
Flask-JWT-Extended==3.24.1
Flask-Login==0.4.1
Flask-SQLAlchemy==2.4.1
[{
"os": "Windows",
"os_version": "XP",
"browser": "opera",
"device": null,
"browser_version": "12.15",
"real_mobile": null
}, {
"os": "Windows",
"os_version": "XP",
This file has been truncated, but you can view the full file.
[
{
"web_pages": [
"https://www.cstj.qc.ca",
"https://ccmt.cstj.qc.ca",
"https://ccml.cstj.qc.ca"
],
"name": "Cégep de Saint-Jérôme",
"alpha_two_code": "CA",
"state-province": null,
This file has been truncated, but you can view the full file.
[
{
"web_pages": [
"https://www.cstj.qc.ca",
"https://ccmt.cstj.qc.ca",
"https://ccml.cstj.qc.ca"
],
"name": "Cégep de Saint-Jérôme",
"alpha_two_code": "CA",
"state-province": null,
@hanikhan
hanikhan / loadimpact.js
Created October 22, 2018 10:24
loadimpact k6 sample test
import http from "k6/http";
import { sleep } from "k6";
export let options = {
vus: 10,
duration: "30s"
};
export default function() {
http.get("http://test.loadimpact.com");
@hanikhan
hanikhan / transparent_proxy.js
Created September 11, 2018 15:11
Capture payload generated by selenium remote web driver using node
//Steps for setup
//Install node if not already installed
//Run 'npm install body-parser -s' (This will install body-parser dependency)
//Run 'npm install express -s' (This will install express dependency)
//Save this code with a .js file extension and run it using 'node filename.js'
//This should intercept all traffic flowing into localhost:4444. This code can be extended to forward request to desired endpoint
var http = require('http');
var express = require('express'),
app= express();
@hanikhan
hanikhan / YOLO.md
Last active September 6, 2018 07:57
YOLO DRIVEN DEVELOPMENT - Just some random stuff I saw on the internet and thought I should keep a copy

-Do not refactor, it is a bad practice. YOLO

-Not understanding why or how something works is always good. YOLO

-Do not ever test your code yourself, just ask. YOLO

-No one is going to read your code, at any point don't comment. YOLO

-Why do it the easy way when you can reinvent the wheel? Future-proofing is for pussies. YOLO

@hanikhan
hanikhan / customMethod.java
Last active August 5, 2018 11:11
Custom method to handle issue with sendKeys on IE 11 where some keys are skipped or not entered correctly
//Currently, the code uses element.getAttribute("value") to get text from text box. This can also be replaced with element.getText() based on the type of text box
private void CustomSendKeysIE(WebElement element, String stringToEnter) throws InterruptedException {
//Convert String to be entered to a character array
char[] charsToEnter = stringToEnter.toCharArray();
//Iterate characters in the character array over a loop
for(int i=0;i<charsToEnter.length;i++){
//Adding a sleep of 500 milliseconds
Thread.sleep(500);
@hanikhan
hanikhan / logging.bat
Created July 30, 2018 13:48
Log BrowserStackLocal process details to a log file using bat file on Windows system
@ECHO OFF
REM Run this bat file from Windows Command Prompt in the following format: name_of_bat interval_for_logging. Example: logging 10
REM Checking if argument specified for the command is valid
SET "var="&for /f "delims=0123456789" %%i in ("%1") do set var=%%i
if defined var (goto :end) else (goto :start)
:start
echo Hit Ctrl+C to stop logging!
:loop
<nul set /p "=%time% " >>bslocal.log
tasklist|find /i "BrowserStack" >>bslocal.log
@hanikhan
hanikhan / logging.sh
Last active July 30, 2018 13:49
Log BrowserStackLocal process details to a log file using shell script on MAC OS X and Linux systems
#!/bin/bash
#To start logging output of grep command every 10 seconds, use:
#Mac: sh logging.sh 10
#Linux: bash logging.sh 10
if [ "$1" != "" ]; then
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo "Invalid Argument" >&2; exit 1