Skip to content

Instantly share code, notes, and snippets.

View alaydeliwala's full-sized avatar
📝
Learning

Alay Deliwala alaydeliwala

📝
Learning
View GitHub Profile
@alaydeliwala
alaydeliwala / myepicntf.json
Last active December 15, 2021 00:40
tokenURI for my test NFT
{
"name": "mandala effect",
"description": "ooh, ahh, pretty colors",
"image": "https://user-images.githubusercontent.com/21965095/146101588-31b3e8d3-7677-426e-ac1a-87f2d75fcd67.png"
}
@alaydeliwala
alaydeliwala / extract_json_keys.go
Created October 20, 2021 21:24
Given an object (json), write code to extract all the keys from it.
func flattenJSON(source string) []string{
return flattenJSONWorker(source, "")
}
// source is the json object and parent initially is ""
func flattenJSONWorker(source string,parent string) []string{
res := make([]string,0)
var arr map[string]gjson.Result
if gjson.Parse(source).IsObject(){
@alaydeliwala
alaydeliwala / jackett-hack.md
Created April 16, 2021 13:43
add all the public trackers to jackett

Source: Jackett/Jackett#1576 (comment)

From the Jackett page, click the "add indexer" button so that the pop up window with the full list of indexers appears.

You'll then need to open your browser's development toolbar (in Chrome just hit F12) and go to the JavaScript Console and enter the following:

////hack to add all free indexers in Jackett
$(document).ready(function () {
	EnableAllUnconfiguredIndexersList();
@alaydeliwala
alaydeliwala / example-chrome-test.go
Created March 9, 2021 21:46
A sample selenium test using a remote webdriver
var executorGuestUrl = "http://127.0.0.1/wd/hub"
func main() {
var caps = make(selenium.Capabilities)
caps["browserName"] = "chrome"
caps["name"] = "[Go] Sample Test"
expectedTitle := "The Go Programming Language"
wd, err := selenium.NewRemote(caps, executorGuestUrl)
@alaydeliwala
alaydeliwala / example-webdriver-test.py
Created March 9, 2021 21:03
An example selenium test that uses a remote webdriver
from selenium import webdriver
desired_cap = {
'browserName': 'chrome',
'name': '[Python] Sample Test',
}
remote_driver_addr = "'http://127.0.0.1:4444/wd/hub'"
driver = webdriver.Remote(