Skip to content

Instantly share code, notes, and snippets.

@peterdemin
peterdemin / kibitzr.yml
Created May 27, 2017 21:40
Banks aggregation
checks:
- name: bofa
url: https://www.bankofamerica.com/
form:
- id: onlineid1
creds: keyring.bofa.username
- id: passcode1
creds: keyring.bofa.password
- id: hp-sign-in-btn
@peterdemin
peterdemin / kibitzr.yml
Created May 27, 2017 21:42
Stash aggregation
transform:
- jinja: |
{%- set bofa = stash.bofa_credit | float -%}
{%- set discover = stash.discover | float -%}
{%- set amex = stash.amex | float -%}
{%- set checking = stash.bofa_checking | float -%}
{%- set savings = stash.bofa_savings | float -%}
{%- set credits = bofa + discover + amex -%}
{%- set total = -bofa - discover - amex + checking + savings -%}
```text
@peterdemin
peterdemin / kibitzr.yml
Created May 9, 2017 15:43
TD Bank check
checks:
- name: TD
url: https://onlinebanking.tdbank.com/
form:
- id: txtUser
value: creds.td.username
- id: txtPassword
value: creds.td.password
transform:
- css: #balance
@peterdemin
peterdemin / kibitzr.yml
Created May 7, 2017 01:34
Discover check
checks:
- name: Discover
url: https://www.discover.com/
form:
- id: userid
creds: discover.login
- id: password
creds: discover.password
delay: 5
transform:
@peterdemin
peterdemin / kibitzr.yml
Created May 6, 2017 00:01
American Express check
checks:
- name: AmEx
url: https://www.americanexpress.com/
form:
- id: Username
creds: amex.username
- id: Password
creds: amex.password
- id: loginLink
click: true
@peterdemin
peterdemin / cleanup_tasks.py
Created March 31, 2017 19:21
Django management command to delete old celery tasks from database using batches of adaptive size
import time
from django.core.management.base import BaseCommand
from django.db.models import Max, Min
from django.db.utils import ProgrammingError
from djcelery.models import TaskMeta
class Command(BaseCommand):
help = 'Delete old celery tasks'
@peterdemin
peterdemin / sorts.py
Last active May 6, 2016 03:07
Exercises implementing different sorting algorithms
"""
Example output:
Random string of 1024 alphanumerics:
imbsnSkVml0zBLoTafc7hH2o1Nk6GJNKZAOxVKWMSkbA9wuUMKLTaIwcfLzIAxdMlwmO6d1r
Siwtk4nPgCbZVAph5x6LTcIcWQT284YqsSKoN87a2dmLQd5JHPSlzC4HgThJa97zXvS9MCNE
zcrbeSHresDyZjhLx8t2PsAXQ012dPDnJuy0RxIPzzVI0x6aZNqYcbXYy5z1SaeRzWVvKO6i
rAnRsQ41u30eAg0AY6o4ebQb7iiIr5bpJUmsCsdStXLMoVMQuJBPXaA5RvWaMztVMG5No9rA
uhBFx6Jh3hGPLEFk7jSFI6sCi6VkpnePUczrbDMmC4cmHHPmi8SztAxEpkZNk68uumzS8EAf
@peterdemin
peterdemin / .gitconfig
Last active December 26, 2015 20:49
Git settings for using Meld under Windows. (C:\Users\user\.gitconfig) Note: Meld's executable path must not contain spaces or non-ascii characters!
[merge]
tool = meld
[mergetool "meld"]
prompt = false
keepBackup = false
keepTemporaries = false
path = C:/Meld/meld/meld.exe
cmd = "/c/Meld/meld/meld.exe $PWD/$LOCAL $PWD/$BASE $PWD/$REMOTE --output=$PWD/$MERGED"
@peterdemin
peterdemin / stress_heap.c
Created October 15, 2013 05:25
Slightly rewritten test from http://bugs.python.org/issue19246 that demonstrates memory fragmentation issue.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int create_huge_linked_list(void **last_item) {
int i;
void *prev_item = NULL;
for(i = sizeof(void *); i < 1000000; i++) {
@peterdemin
peterdemin / install-build-agent.sh
Last active December 22, 2015 15:59 — forked from ianbattersby/gist:4641450
Script meant to be used as vagrant shell provisioner. It doesn't use /vagrant shared folder though. That means it can be launched from any remote debian machine.
#!/bin/bash
# Replace this with actual server address
serverUrl="10.1.136.242:80"
if [ -e "/etc/init.d/teamcity" ]
then
echo "TeamCity allready installed"
exit 0
fi