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
import functools | |
def calc(x, y, mode): | |
if mode == '+': | |
return x + y | |
elif mode == '-': | |
return x - y | |
elif mode == '*': | |
return x * y | |
elif mode == '/': |
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
%define _version 1.3.0 | |
%define _revision 1.3.0 | |
%define _release 1 | |
Name: riak | |
Version: %{_version} | |
Release: %{_release}%{?dist} | |
License: Apache License | |
Group: Development/Libraries | |
Source: %{name}-%{_revision}.tar.gz |
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
# Install pyenv in ~/.pyenv | |
cd ~ | |
git clone git://github.com/yyuu/pyenv.git .pyenv | |
echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.zshrc | |
echo 'if [ -d "${PYENV_ROOT}" ]; then' >> ~/.zshrc | |
echo ' export PATH=${PYENV_ROOT}/bin:$PATH' >> ~/.zshrc | |
echo ' eval "$(pyenv init -)"' >> ~/.zshrc | |
echo 'fi' >> ~/.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
#!/usr/local/bin/python | |
import requests | |
import json | |
def call_rabbitmq_api(host, port, user, passwd): | |
url = 'http://%s:%s/api/queues' % (host, port) | |
r = requests.get(url, auth=(user,passwd)) | |
return r |
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
mkdir /perl | |
export PERLBREW_ROOT=/perl | |
curl -L --insecure http://xrl.us/perlbrewinstall | bash | |
echo 'export PERLBREW_ROOT=/perl' >> ~/.zshrc | |
echo '[ -f /perl/etc/bashrc ] && source /perl/etc/bashrc' >> ~/.zshrc | |
source ~/.zshrc | |
perlbrew available | |
perlbrew install perl-5.16.2 | |
perlbrew switch perl-5.16.2 | |
perlbrew install-cpanm |
NewerOlder