Install and start nginx:
sudo apt-get update
sudo apt-get install nginx
sudo /etc/init.d/nginx start
#!/usr/bin/python -O | |
from collections import defaultdict | |
from random import random, choice | |
from string import ascii_lowercase | |
from subprocess import Popen, PIPE | |
from time import time, sleep | |
# get a list of words with only ASCII characters | |
words = [w.strip().lower() for w in open("/usr/share/dict/words").readlines()] | |
words = [w for w in words if all([c in ascii_lowercase for c in w])] |
Транслитерация кириллицы для русского алфавита, ГОСТ Р 52535.1-2006 (Приложение А) | |
Transliteration of cyrilic of Russian alphabet, GOST R 52535.1-2006 (Appendix A) | |
1 А A | |
2 Б B | |
3 В V | |
4 Г G | |
5 Д D | |
6 Е E | |
7 Ё E |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Olivier Scherrer | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
# Installing Sublime Text 2 | |
# Based on [https://gist.github.com/jansanchez/6202643] | |
# Download the latest version from: http://www.sublimetext.com/2 | |
cd ~/downloads | |
# wget http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.tar.bz2 | |
# Unpack it | |
tar -xvf Sublime\ Text\ 2.0.2.tar.bz2 | |
# Move the folder to "/opt" | |
sudo mv Sublime\ Text\ 2 /opt/ | |
# Create a symbolic link in "/usr/bin": |
/** | |
* Sets a hook for a method call for the given object. Acts as a simple observer of object's methods. | |
* @param {Object} object An object. | |
* @param {Function} method A method of the object. | |
* @param {Function} hook A callback function which will be called after the call of object's method. | |
* @param {Function} [context] Context which will passed to the hook instead of `this`. | |
* @return {Function} after Returns itself for chained calls. | |
*/ | |
function after(object, method, hook, that) { | |
var old = object[method]; |
# usage: ./compress_js.sh file.js compressed/file.js | |
curl -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_format=text -d output_info=compiled_code --data-urlencode "js_code@$1" http://closure-compiler.appspot.com/compile > $2 |
{ | |
"questions":[ | |
{ | |
"id":1, | |
"question":"Часто ли вы испытываете тягу к новым впечатлениям, к тому, чтобы «встряхнуться», испытать возбуждение?", | |
"value":true | |
}, | |
{ | |
"id":2, | |
"question":"Часто ли вы нуждаетесь в друзьях, которые вас понимают, могут ободрить или утешить?", |
// Returns entire web page height | |
function page_height () { | |
return Math.max( | |
document.body.scrollHeight, document.documentElement.scrollHeight, | |
document.body.offsetHeight, document.documentElement.offsetHeight, | |
document.body.clientHeight, document.documentElement.clientHeight | |
); | |
} | |
// Returns visible web page height |
function inherit(child, parent) {
child.parent = parent;