Skip to content

Instantly share code, notes, and snippets.

@ashishk1996
ashishk1996 / algoliaSearch.py
Created August 5, 2021 09:41
Querying code for Algolia to check if replica index is queryable or not
# Python 3.8.2, 64bit, algoliasearch==2.5.0
from algoliasearch.search_client import SearchClient
#fetching data from algolia
ALGOLIA_APP_ID="<INSERT APP ID HERE>"
ALGOLIA_API_KEY="******************c1607" # ignore stars, only suffix is valid
client = SearchClient.create(ALGOLIA_APP_ID, ALGOLIA_API_KEY)
algoliaIndex = "v3_prod_author_recent"
index = client.init_index(algoliaIndex)
res = index.search('dummy data')
import argparse
import django
import os
import traceback
from random import randint
parser = argparse.ArgumentParser()
text = 'Reco server is starting up'
parser.add_argument("--settings", "-s", help="facade settings")
@ashishk1996
ashishk1996 / doubleclickinput.html
Last active June 23, 2020 23:27
input box popup on double click
<!DOCTYPE>
<html>
<head>
<title>Text on mouse pointer</title>
<style type="text/css">
body{
position: relative;
}
@ashishk1996
ashishk1996 / div.html
Last active September 11, 2019 12:33
<div class="tag-container"><div class="tag"><div class="tag-label">Product</div><div class="tag-close"><svg height="14" width="14" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="tag-close-svg"><path d="M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"></path></svg></div></div><div class="tag"><div class="tag-label">State</div><div class="tag-close"><svg height="14" width="14" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="tag-close-svg"><path d="M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.46