Skip to content

Instantly share code, notes, and snippets.

nochristrequired

Block or report user

Report or block nochristrequired

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pep8_cheatsheet.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
View gist:c7ee0fe6780fac19faa9344f50f2a4f7
public interface IRtdClient
{
object GetValue(params object[] args);
}
public class RtdClient : IRtdClient
{
readonly string _rtdProgId;
static IRtdServer _rtdServer;
View aiopg playing with aiohttp and gunicorn.md

aiopg playing with aiohttp and gunicorn

Setup

virtualenv -p /usr/bin/python3.5 env && source env/bin/activate
pip install SQLAlchemy aiohttp aiopg gunicorn

Usage

View sqlalchemy_example.py
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
class BaseMixin(object):
query = DBSession.query_property()
id = sa.Column(sa.Integer, primary_key=True)
View iso countries list (csv)
"name","iso_name","iso2","iso3","numcode"
"Antigua and Barbuda","ANTIGUA AND BARBUDA","AG","ATG",28
"Bosnia and Herzegovina","BOSNIA AND HERZEGOVINA","BA","BIH",70
"Cocos (Keeling) Islands","COCOS (KEELING) ISLANDS","CC","\N","\N"
"Congo, the Democratic Republic of the","CONGO, THE DEMOCRATIC REPUBLIC OF THE","CD","COD",180
"Cote D'Ivoire","COTE D'IVOIRE","CI","CIV",384
"Fiji","FIJI","FJ","FJI",242
"French Southern Territories","FRENCH SOUTHERN TERRITORIES","TF","\N","\N"
"Heard Island and Mcdonald Islands","HEARD ISLAND AND MCDONALD ISLANDS","HM","\N","\N"
"Holy See (Vatican City State)","HOLY SEE (VATICAN CITY STATE)","VA","VAT",336
@nochristrequired
nochristrequired / consul.service
Created Dec 24, 2015 — forked from yunano/consul.service
/etc/systemd/system/consul.service
View consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
You can’t perform that action at this time.