Skip to content

Instantly share code, notes, and snippets.

View dgk's full-sized avatar
🇬🇪

Dmitry Kuksinsky dgk

🇬🇪
View GitHub Profile
@dgk
dgk / backprop.py
Created December 22, 2011 18:21
pybrain implementation of M. Tim Jones AI Application Programming chapter 5 sample code
# -*- coding: utf-8 -*-
from pybrain.tools.shortcuts import buildNetwork
from pybrain.datasets.supervised import SupervisedDataSet
from pybrain.supervised.trainers.backprop import BackpropTrainer
from pybrain.structure.modules.softmax import SoftmaxLayer
from pybrain.structure.modules.tanhlayer import TanhLayer
actions = ("Attack", "Run", "Wander", "Hide")
@dgk
dgk / pylife.py
Created December 26, 2011 11:36
Artificial life simulator
#!/usr/bin/env python
'''
usage: ./pylife.py
or ./pylife.py test
requirements:
PyBrain==0.3
numpy==1.6.1
scipy==0.10.0
'''
FILE=$1
if [ -z "$FILE" -o ! -f "$FILE" ] ; then
echo specify valid regular file name
exit 1
fi
REVISIONS=`svn log -q $FILE |grep -vE '^---' | sed -e 's/ .*//'`
for REV in $REVISIONS
do
echo fetching revision `echo $REV | sed -e 's/r//'`
svn up -q -r $REV $FILE
@dgk
dgk / weeding.py
Created November 14, 2012 08:53
Backups weeding script
#!/usr/bin/python
# -*- coding: utf8 -*-
import os
import re
import datetime
from calendar import Calendar
from itertools import chain
KEEP_DAY = 0
@dgk
dgk / stat.py
Created November 13, 2013 07:53
# -*- coding: utf-8 -*-
from collections import OrderedDict
prices = [
390000,
550000,
550000,
580000,
665000,
670000,
@dgk
dgk / initserv.sh
Last active August 29, 2015 13:56
#!/bin/bash
# curl -L https://gist.github.com/dgk/8961718/raw/initserv.sh | sh
mkdir -m 700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
apt-get install git tmux zsh vim-nox mc rar curl
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
sed -i 's/ZSH_THEME=.*/ZSH_THEME="aussiegeek"/' ~/.zshrc
git config --global color.ui true
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global core.quotepath off
git config --global core.editor vim
git config --global merge.ff true
git config --global core.pager ""
#git config --global user.name root
python -c "import sys,json,locale;print json.dumps(json.loads(sys.stdin.read()), sort_keys=True, indent=4).decode('unicode-escape').encode(locale.getpreferredencoding())"
@dgk
dgk / init_zsh
Last active August 29, 2015 14:15
curl -L https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
sed -i 's/ZSH_THEME=.*/ZSH_THEME="aussiegeek"/' ~/.zshrc
chsh -s /bin/zsh
@dgk
dgk / README.md
Last active August 29, 2015 14:17 — forked from marcoslin/.gitignore
Encryption: From PyCrypto to CryptoJS

Encryption: From PyCrypto to CryptoJS

Sample code to encrypt using Python and decrypt in Javascript