A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
############################################################################### | |
# The MIT License | |
# | |
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
#include <SPI.h> | |
#include <Ethernet.h> | |
#include <LiquidCrystal.h> | |
// prepare for lcd shield | |
LiquidCrystal lcd( 8 , 9 , 4 , 5 , 6 , 7 ) ; | |
// prepare for ethernet shield | |
byte mac[] = { 0x00 , 0x08 , 0xDC , 0x00 , 0x00 , 0x09 } ; |
void loop() { | |
// verify if there is new client connected | |
EthernetClient client = server.available() ; | |
if ( !client ) return ; | |
// prepare for reading request data | |
boolean isBlankLine = true ; | |
// read and proces the client request data |
#!/bin/bash | |
NAME="hello_app" # Name of the application | |
DJANGODIR=/webapps/hello_django/hello # Django project directory | |
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
USER=hello # the user to run as | |
GROUP=webapps # the group to run as | |
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
import win32serviceutil | |
import win32service | |
import win32event | |
import servicemanager | |
import socket | |
import time | |
import logging | |
logging.basicConfig( | |
filename = 'c:\\Temp\\hello-service.log', |
# D-I config version 2.0 | |
default debian/7.4/amd64/boot-screens/vesamenu.c32 | |
prompt 1 | |
timeout 300 | |
menu title - Boop Menu - | |
label Debian-7.4 | |
menu label ^0 Debian 7.4 | |
#include debian/7.4/amd64/boot-screens/menu.cfg | |
kernel debian/7.4/amd64/linux |
Google Chrome Developers says:
The new WOFF 2.0 Web Font compression format offers a 30% average gain over WOFF 1.0 (up to 50%+ in some cases). WOFF 2.0 is available since Chrome 36 and Opera 23.
Some examples of file size differences: WOFF vs. WOFF2
IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).
USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.
IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites. It obviously depends on your use case.