Skip to content

Instantly share code, notes, and snippets.

Kiran Jonnalagadda jace

Block or report user

Report or block jace

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View uuid64.py
#!/usr/bin/env python
"""
Functions to represent UUIDs as Base64 strings.
Base64 typically uses '+' and '/' as encoding characters. Neither are URL-safe,
so these functions use ',' and '-'. The characters '.' and '_' were considered,
but rejected, as some web frameworks will treat any URL fragment starting with
them as a hidden resource.
"""
@jace
jace / ndistro-output
Created Apr 3, 2011
Output from ndistro for Tilemill.
View ndistro-output
jace@razor ~/Downloads/mapbox-tilemill-4ba9aea $ ./ndistro [22:32:25]
... building node-0.2.6
######################################################################## 100.0%
Waf: Entering directory `/Users/jace/Downloads/mapbox-tilemill-4ba9aea/src/node-0.2.6/build'
[ 1/69] cc: deps/libeio/eio.c -> build/default/deps/libeio/eio_1.o
In file included from ../deps/libeio/eio.c:77:
default/config.h:10:1: warning: "HAVE_FDATASYNC" redefined
<command-line>: warning: this is the location of the previous definition
[ 2/69] cc: deps/libev/ev.c -> build/default/deps/libev/ev_1.o
In file included from ../deps/libev/ev.c:49:
View pydocflow-readme.rst

Python Document Workflows

An implementation of document workflows in Python. Designed for SQLAlchemy but not dependent upon it.

Note: This is currently just a planning document.

Usage:

@jace
jace / test_docflow.py
Created Apr 30, 2011
PyDocFlow tests
View test_docflow.py
# -*- coding: utf-8 -*-
import unittest
from docflow import (DocumentWorkflow, WorkflowState, WorkflowStateGroup,
WorkflowStateException, WorkflowTransitionException, WorkflowPermissionException)
class MyDocument(object):
def __init__(self):
self.status = None
self.email = ''
@jace
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
Thanks
[snip]
---------- Forwarded message ----------
@jace
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
Thanks
[snip]
---------- Forwarded message ----------
@jace
jace / sum-decimal.py
Created Mar 17, 2013
Just how much slower is it to add up decimals than to add up integers?
View sum-decimal.py
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
jace / upgrade.sh
Created Dec 22, 2016
Upgrade Python 2.7 virtualenv under Homebrew
View upgrade.sh
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <venv_dir>"
else
rm $1/bin/pip
rm $1/bin/pip2
rm $1/bin/pip2.7
rm $1/bin/python
rm $1/bin/python2
@jace
jace / bulletinbabu.py
Created Dec 14, 2017
Bulletin Babu for #SpeakForMe
View bulletinbabu.py
#!/usr/bin/env python
"""
Script to count the emails received by #SpeakForMe
"""
import os
import sys
import tweepy
import requests
@jace
jace / twitter.ublock
Last active Jun 4, 2018
Remove spam from Twitter notifications
View twitter.ublock
! Add these under uBlock Settings -> My filters
twitter.com##.js-new-items-bar-container
twitter.com##.js-activity-favorite
twitter.com##.js-activity-favorited_retweet
twitter.com##.js-activity-retweet
twitter.com##.stream-item-favorited_mention
twitter.com##.stream-item-retweet
twitter.com##.stream-item-retweeted_retweet
twitter.com##.stream-item-retweeted_mention
twitter.com##li.people.notifications .count.new-count
You can’t perform that action at this time.