Skip to content

Instantly share code, notes, and snippets.

View adamshamsudeen's full-sized avatar
🎯
Focusing

Adam Shamsudeen adamshamsudeen

🎯
Focusing
View GitHub Profile
@adamshamsudeen
adamshamsudeen / cmd.sh
Created January 8, 2019 07:18 — forked from meain/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@adamshamsudeen
adamshamsudeen / mongo.py
Created November 30, 2018 08:00
Basics of using mongodb with python
from pymongo import MongoClient
client = MongoClient()
db = client.alexa
users_collection = db.user_details
#insert
users_collection.insert_one({"user":id,
"time":datetime.datetime.utcnow(),
"activated":False,
@adamshamsudeen
adamshamsudeen / get_ngrok_hotsname.sh
Last active November 22, 2018 08:59
script to extract the ngrok forwarding hostname
#!/bin/bash
# Thanks to @fvclaus
curl --silent --show-error http://127.0.0.1:4040/api/tunnels | sed -nE 's/.*public_url":"(https:[^"]*).*/\1/p'
@adamshamsudeen
adamshamsudeen / characters.py
Created October 13, 2018 16:40
Malayalam character unicodes
malayalam_character = ['അ','ആ','ഇ','ഈ','ഉ','ഊ','ഋ','ഌ','എ','ഏ','ഐ','ഒ','ഓ','ഔ','ക','ഖ','ഗ','ഘ','ങ','ച','ഛ','ജ','ഝ','ഞ','ട','ഠ','ഡ','ഢ','ണ','ത','ഥ','ദ','ധ','ന','ഩ','പ','ഫ','ബ','ഭ','മ','യ','ര','റ','ല','ള','ഴ','വ','ശ','ഷ','സ','ഹ','ഺ','\u0d3c','ഽ','ാ','ി','ീ','ു','ൂ','ൃ','ൄ','െ','േ','ൈ','\u0d49','ൊ','ോ','ൌ','്','ൎ','ൗ','ൠ','ൡ','ൢ','ൣ','൦','൧','൨','൩','൪','൫','൬','൭','൮','൯','൹','ൺ','ൻ','ർ','ൽ','ൾ','ൿ','ං']