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 time, random | |
PROCESS = True | |
JOB_POOL_SIZE = 10 | |
DATABASE_POOL_SIZE = 5 | |
def apply_job(arg): | |
r = random.random() *10 | |
time.sleep(r) | |
return (arg, 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
DEBUG=True | |
SOUTH_TESTS_MIGRATE = True | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. | |
'NAME': 'geo', # Or path to database file if using sqlite3. | |
'USER': 'postgres', # Not used with sqlite3. | |
'PASSWORD': 'postgres', # Not used with sqlite3. | |
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3. |
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
alias ll='ls -lah --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F' | |
alias la='ls -A' | |
alias l='ls -CF' | |
alias upgrade='sudo apt-get update && sudo apt-get dist-upgrade -V && sudo pip install --upgrade pip virtualenv virtualenvwrapper fabric && sudo npm update -g' | |
alias h='history | grep $1' | |
alias psg='ps -ef | grep $1' | |
alias ..='cd ..' | |
function my_ip() # get IP adresses | |
{ |
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
<link rel="import" href="../core-ajax/core-ajax.html"> | |
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: relative; |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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/sh | |
sudo apt-get update | |
sudo apt-get --yes install python-pip | |
sudo apt-get --yes install vim | |
sudo apt-get --yes install htop | |
sudo apt-get --yes install ncdu | |
sudo pip install --upgrade 'pip<7' | |
sudo pip install --upgrade ansible | |
sudo pip install --upgrade virtualenv virtualenvwrapper | |
sudo apt-get dist-upgrade -V |
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
<?php | |
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$IParray=array_values(array_filter(explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']))); | |
$_SERVER['REMOTE_ADDR'] = reset($IParray); | |
} | |
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { | |
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){ | |
$_SERVER['REQUEST_SCHEME'] = 'https'; | |
$_SERVER['HTTPS']='on'; |
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 -*- | |
import pip, os | |
from pip.commands.list import ListCommand | |
from pip.req import parse_requirements | |
import re | |
import argparse | |
class MyListCommand(ListCommand): |
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
wget https://bootstrap.pypa.io/get-pip.py | |
sudo python get-pip.py | |
rm get-pip.py | |
sudo pip install virtualenv | |
#virtualenv --no-site-packages my_virtualenv_name | |
mkdir .virtualenvs | |
sudo pip install virtualenvwrapper | |
export WORKON_HOME=$HOME/.virtualenvs | |
export PROJECT_HOME=$HOME/git |
OlderNewer