Skip to content

Instantly share code, notes, and snippets.

Konstantin Alekseev kalekseev

View GitHub Profile
View test_admin_form.py
def get_inital_data(response):
data = {}
for inline in response.context_data['inline_admin_formsets']:
form = inline.formset.management_form
for k, v in form.initial.iteritems():
data[form.prefix + '-' + k] = v
form = response.context_data['adminform'].form
for field_name in form.changed_data:
data[field_name] = form.fields[field_name].initial
return data
@kalekseev
kalekseev / Tips.md
Created Feb 23, 2015
Different tips and tricks
View Tips.md

Split cue audio file

sudo apt-get install cuetools shntool flac wavpack
wvunpack file.vw
cuebreakpoints file.cue | shnsplit -o flac file.wav
View keybase.md

Keybase proof

I hereby claim:

  • I am kalekseev on github.
  • I am kalekseev (https://keybase.io/kalekseev) on keybase.
  • I have a public key whose fingerprint is D693 0C6C CBD9 274D 1D2A 8000 7AC1 ECDF D1B6 C980

To claim this, I am signing this object:

View ai1.erl
%Stanford www.ai-class.com. Optional NLP Programming
%For test use:
%ai1:decode("Esp qtcde nzyqpcpynp zy esp ezatn zq Lcetqtntlw Tyepwwtrpynp hld spwo le Olcexzfes Nzwwprp ty estd jplc.").
%corpus test 1: http://simple.wikipedia.org/wiki/Wikipedia:List_of_1000_basic_words
%corpus test 2: http://www.wordfrequency.info/files/entriesWithoutCollocates.txt
-module(ai1).
-export([decode/1]).
decode(List) ->
You can’t perform that action at this time.