Skip to content

Instantly share code, notes, and snippets.

View silpol's full-sized avatar
🏠
Email is best comm tool.

Andriy Tymchenko silpol

🏠
Email is best comm tool.
View GitHub Profile
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

@starenka
starenka / .gitignore
Created September 18, 2011 20:02
fabfile to deploy flask app to nginx/supervisor/uwsgi stack
.idea/*
*.pyc
@tedhagos
tedhagos / install-steps-gnu-health
Created January 2, 2012 03:07
Installation notes for GNU Health
1. Make sure you have the following requisites
- Debian or Ubuntu
- Postgresql
- Python
- Tryton
2. Install requisite software
2.1 apt-get install python-pip python-lxml python-relatorio python-psycopg2 posgresql python-tz
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@simoncoulton
simoncoulton / nginx-uwsgi-python3
Created May 7, 2012 04:39
Setting up Nginx, uWSGI & Python3
======================================
Setting up Nginx, uWSGI and Python3
======================================
First off, I'm traditionally a PHP developer, but am looking at moving across to Python. I really struggled to find decent documentation on how to get a server up and running for deploying Python web applications from the point of view of someone coming from PHP. The main problems I came across with documentation were:
1) Only showed you how to run the server for a single web application.
2) Only showed you how to configure the app, not the server it was running on.
My preferred workflow for development is by setting up a new VM in VMware Fusion and then forwarding through all requests to that VM via /etc/hosts. This might not be the optimal way to get things up and running, but it works for me.
@woodb
woodb / tree.md
Created May 10, 2012 00:25 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@jcinis
jcinis / gist:2866253
Created June 4, 2012 04:02
Generate a random username for Django
from random import choice
from string import ascii_lowercase, digits
from django.contrib.auth.models import User
def generate_random_username(length=16, chars=ascii_lowercase+digits, split=4, delimiter='-'):
username = ''.join([choice(chars) for i in xrange(length)])
if split:
username = delimiter.join([username[start:start+split] for start in range(0, len(username), split)])
@woodb
woodb / setup_flask_and_friends.sh
Created July 8, 2012 16:43
Shell script to get setup with Flask, nginx and uWSGI on an Amazon EC2 Linux image
#!/bin/bash
#
# Shell script to automatically configure a new Flask, nginx and uWSGI based blog
# on an Amazon EC2 instance.
#
# See http://bit.ly/MeGwjD for more information!
#
# If you are forking this for your own custom configuration script, see the following other gists:
# https://gist.github.com/3071737
# https://gist.github.com/3071739
@woodb
woodb / uwsgi.conf
Created July 8, 2012 16:46
Configuration file for uWSGI
description "uWSGI"
start on runlevel [2345]
stop on runlevel [06]
respawn
env UWSGI=/usr/bin/uwsgi
env LOGTO=/var/log/uwsgi/emperor.log
exec $UWSGI --master --emperor /etc/uwsgi/apps-enabled --die-on-term --uid nginx --gid nginx --logto $LOGTO