Skip to content

Instantly share code, notes, and snippets.

View App Revenue

If you've ever wondered what it's be like to "go indie" here is a script with some assumptions that might help you project your income.


  • You will make a new app every month
  • Apps have a useful life of 3 years (after that they stop earning money)
  • Apps will earn $250 in their launch month
  • Apps will earn $100/mo at first (starting month 2), but that revenue will slowly decline (~50% each year)
  • As you make more apps your brand/mailing list will start to pay dividends (after 4 apps you'll see the numbers above double, after 8 they'll 3x, and so on)

So how would that work out?


Keybase proof

I hereby claim:

  • I am jiaaro on github.
  • I am jiaaro ( on keybase.
  • I have a public key ASAmjWlR2gGlcJGuKzzPQ4UDqxXW0WeP-NDoJACLKWKo7go

To claim this, I am signing this object:

jiaaro /
Last active Mar 16, 2016
Calculate the value of your investments and savings at some point in the future
class Investment(object):
def cash_invested_by_month(self, month):
raise NotImplementedError
def value_in_month(self, month):
raise NotImplementedError
class SingleInvestment(Investment):
def __init__(self, amount, monthly_interest_rate, month=0):
jiaaro /
Last active Jan 4, 2016
NOTE: belongs in a directory "breeder"
#!/usr/bin/env python
import ast
from os.path import isfile
from hashlib import md5
from random import randint, choice
from glob import glob
import re
# scratch area
jiaaro /
Last active Jun 12, 2021
Using Swift libraries in Python

Using Swift libraries in Python

So... this is obviously totally, 100%, like for. real. not. supported. by. Apple. …yet?

But still... I thought it was pretty badass. And, seeing how there's already a Swift buildpack for Heroku you could move some slow code into Swift can call it as a library function. But, you know, not in production or anything. That would be silly, right?

Now, having said that, the actual Python/Swift interop may have bugs. I'll leave that as an exercise to the reader.

How to get Python code calling Swift functions:

View gist:89a7427a1dfabbb6c213
// using jQuery
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
jiaaro /
Last active Aug 29, 2015
formset example code
class MyForm(forms.Form):
is_interesting = forms.BooleanField(required=False)
def __init__(self, *args, **kwargs):
self.object = kwargs['initial']['obj']
super(MyForm, self).__init__(*args, **kwargs)
def save(self):
jiaaro /
Created May 23, 2015
Make a chord progressions
from pydub import AudioSegment
from pydub.generators import Sine, Square, WhiteNoise
from pydub.playback import play
# From
def note_to_freq(note, concert_A=440.0):
from wikipedia:
return (2.0 ** ((note - 69) / 12.0)) * concert_A
# Timings taken on a MacBook Pro (Retina, 15-inch, Mid 2014)
# running OS X 10.10.3
In [1]: import sys
In [2]: print sys.version
2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
In [3]: data = [{str(x): y+z for x in range(10) for y in range(50)} for z in range(500)]
In [4]: import json
jiaaro /
Created Mar 19, 2015
Super simple BPM detection with pydub
from pydub import AudioSegment
from pydub.silence import detect_nonsilent
seg = AudioSegment.from_file("./ghosts_and_stuff.m4a")
# reduce loudness of sounds over 120Hz (focus on bass drum, etc)
seg = seg.low_pass_filter(120.0)
# we'll call a beat: anything above average loudness
beat_loudness = seg.dBFS