Skip to content

Instantly share code, notes, and snippets.

@iambibhas
iambibhas / nobroker-gmap.js
Last active May 10, 2024 09:49
Adds a google maps search link beside apartment complex listings when you open them on map view
// ==UserScript==
// @name NoBroker Google Maps
// @namespace http://tampermonkey.net/
// @version 2024-05-09
// @description Adds a google maps search link beside apartment complex listings when you open them on map view
// @author Bibhas D
// @match https://www.nobroker.in/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=nobroker.in
// @grant none
// ==/UserScript==
@iambibhas
iambibhas / scopes.txt
Last active May 5, 2024 06:39
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@iambibhas
iambibhas / recipe.xml
Last active June 29, 2023 00:22
Tasker recipe to forward SMS to Telegram group
<TaskerData sr="" dvi="1" tv="5.8.3">
<Profile sr="prof2" ve="2">
<cdate>1565066300570</cdate>
<edate>1567394645768</edate>
<id>2</id>
<mid0>3</mid0>
<nme>Bank SMS Forward</nme>
<Event sr="con0" ve="2">
<code>7</code>
<pri>0</pri>
@iambibhas
iambibhas / kolkata-zoom-14.py
Last active May 20, 2023 13:24
Downloads the OSM tiles and stiches them in a single image
#!/usr/bin/env python
# Generated by BigMap 2. Permalink: http://bigmap.osmz.ru/bigmap.php?xmin=12200&xmax=12231&ymin=7120&ymax=7143&zoom=14&scale=256&tiles=mapnik
import io, urllib2, datetime, time, re, random
from PIL import Image, ImageDraw
# ^^^^^^ install "python-pillow" package | pip install Pillow | easy_install Pillow
(zoom, xmin, ymin, xmax, ymax) = (14, 12200, 7120, 12231, 7143)
layers = ["http://tile.openstreetmap.org/!z/!x/!y.png"]
attribution = 'Map data (c) OpenStreetMap'
@iambibhas
iambibhas / timezones.csv
Last active March 14, 2023 00:54
Commonly used Timezones and offsets
Abbr. Name UTC offset offset offset_seconds
ACDT Australian Central Daylight Savings Time UTC+10:30 10.5 37800
ACST Australian Central Standard Time UTC+09:30 9.5 34200
ACT ASEAN Common Time UTC+08 8 28800
ADT Atlantic Daylight Time UTC−03 -3 -10800
AEDT Australian Eastern Daylight Savings Time UTC+11 11 39600
AEST Australian Eastern Standard Time UTC+10 10 36000
AFT Afghanistan Time UTC+04:30 4.5 16200
AKDT Alaska Daylight Time UTC−08 -8 -28800
AKST Alaska Standard Time UTC−09 -9 -32400
@iambibhas
iambibhas / anchor.html
Created August 26, 2012 16:53
Twitter t.co link shortener bypasser
<a href="http://t.co/acgTzWKR" class="twitter-timeline-link" target="_blank" data-expanded-url="http://tcrn.ch/NTr6S8" title="http://tcrn.ch/NTr6S8" dir="ltr" wotsearchprocessed="true">
<span class="invisible">http://</span>
<span class="js-display-url">tcrn.ch/NTr6S8</span>
<span class="invisible"></span>
<span class="tco-ellipsis">
<span class="invisible">&nbsp;</span>
</span>
</a>
@iambibhas
iambibhas / photo_backup.sh
Last active October 13, 2022 17:41
Move your images to creation date wise folders
#!/bin/sh
SRC_DIR=$1
DEST_DIR=$2
for _file in `find $SRC_DIR -type f`;
do
DATE=`date -r $_file +%F`
DIR="$DEST_DIR$DATE"
echo "$_file -> $DIR"
@iambibhas
iambibhas / tweetdeck_tco_bypass.js
Created December 10, 2013 16:31
Inject this snippet to bypass t.co urls on Tweetdeck https://tweetdeck.twitter.com/
// ==UserScript==
// @name Tweetdeck T.co bypass
// @namespace http://userscripts.org/users/192333
// @version 1
// @include http*://*twitter.com/*
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_info
// ==/UserScript==
@iambibhas
iambibhas / django-image-save.py
Created February 27, 2013 21:30
Programatically save ImageField in Django
import requests
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
def save_image_from_url(model, url):
r = requests.get(url)
img_temp = NamedTemporaryFile(delete=True)
@iambibhas
iambibhas / pstat-chain.py
Last active August 16, 2020 13:07
Takes a profile file, a method name and depth, and shows you the chain of callers of the method
import pstats
import re
import sys
from io import StringIO
"""
E.g.
python pstats-chain.py GET.foobar.com.testurl.46689ms.1597427246.prof 'time.sleep' 10