Skip to content

Instantly share code, notes, and snippets.


Kiran Jonnalagadda jace

View GitHub Profile

Hasgeek Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by Hasgeek Learning Private Limited or its affiliates (“Hasgeek”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Hasgeek in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You hereby grant, and agree to grant, to Hasgeek a non

"""Test whether a descriptor's __set_name__ is called in multiple scenarios."""
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base, declared_attr
Base = declarative_base()
db = SQLAlchemy()
# Performance test for coaster.sqlalchemy.registry.InstanceRegistry
import timeit
class Registry:
def __init__(self, param=None):
self.param = param
class Namespacer1:
jace /
Created May 10, 2020
Performance difference of Python's partial vs partialmethod
from functools import partial, partialmethod
from timeit import timeit
class Partial(Base):
def __init__(self):
self.p = partial(, 1)
class PartialMethod(Base):
jace / twitter.ublock
Last active Jun 4, 2018
Remove spam from Twitter notifications
View twitter.ublock
! Add these under uBlock Settings -> My filters
jace /
Created Dec 14, 2017
Bulletin Babu for #SpeakForMe
#!/usr/bin/env python
Script to count the emails received by #SpeakForMe
import os
import sys
import tweepy
import requests
jace /
Created Dec 22, 2016
Upgrade Python 2.7 virtualenv under Homebrew
if [ $# -ne 1 ]; then
echo "Usage: $0 <venv_dir>"
rm $1/bin/pip
rm $1/bin/pip2
rm $1/bin/pip2.7
rm $1/bin/python
rm $1/bin/python2
jace /
Last active May 26, 2020
Remove noise from video using sox and ffmpeg
# 1. extract audio from all videos (assuming .mp4 videos).
for FILE in *.mp4; do ffmpeg -i $FILE ${FILE%%.mp4}.wav; done
# 2. use the first second of the first audio file as the noise sample.
sox `ls *.wav | head -1` -n trim 0 1 noiseprof
# Replace with a specific noise sample file if the first second doesn't work for you:
# sox noise.wav -n noiseprof
# 3. clean the audio with noise reduction and normalise filters.
jace /
Created Mar 17, 2013
Just how much slower is it to add up decimals than to add up integers?
from random import randint
from decimal import Decimal
import timeit
print "Creating 30 random numbers"
ints = [randint(0, 10000) for x in range(30)]
print "Converting to decimals"
numbers = [Decimal(x) for x in ints]
# This method says sum(Decimal) takes ~1600 times more than sum(int)
jace / recruiter-spam.txt
Created Jan 25, 2013
People, not frogs
View recruiter-spam.txt
@hasgeek , Got this as one of the responses for a listing that
specifically asked "NOT OK for recruiters, HR consultants, and other
intermediaries to contact this employer" . And I don't understand half
of it , what its trying
---------- Forwarded message ----------