Sample code to encrypt using Python and decrypt in Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
usage: ./pylife.py | |
or ./pylife.py test | |
requirements: | |
PyBrain==0.3 | |
numpy==1.6.1 | |
scipy==0.10.0 | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf8 -*- | |
import os | |
import re | |
import datetime | |
from calendar import Calendar | |
from itertools import chain | |
KEEP_DAY = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from collections import OrderedDict | |
prices = [ | |
390000, | |
550000, | |
550000, | |
580000, | |
665000, | |
670000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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())" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer