#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.
import time | |
from django.utils.http import http_date | |
AJAX_NEGATIVE_CHECK_EXPIRES = 60 # object is still available | |
AJAX_POSITIVE_CHECK_EXPIRES = 60*10 # if object is not available (or taken) | |
def check_ajax(request): | |
# do stuff here | |
timeout = AJAX_NEGATIVE_CHECK_EXPIRES if avail else AJAX_POSITIVE_CHECK_EXPIRES |
import re | |
from django.utils.text import compress_string | |
from django.utils.cache import patch_vary_headers | |
from django import http | |
try: | |
import settings | |
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS |
#!/usr/bin/python | |
# coding: utf-8 | |
import urllib | |
import urllib2 | |
from multiprocessing import Pool | |
import Queue, threading | |
reg_nos = [16738, 17288, 18162, 18776, 18868, 19116, 19223, 19505]; | |
pdf_url = 'http://www.mapa.es/agricultura/pags/fitos/registro/sustancias/pdf/%s.pdf' |
#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.
<?php | |
### --- Snip --- ### | |
App::after(function($request, $response) | |
{ | |
// HTML Minification | |
if(App::Environment() != 'local') | |
{ | |
if($response instanceof Illuminate\Http\Response) |
function testWebP(callback) { | |
var webP = new Image(); | |
webP.src = 'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA'; | |
webP.onload = webP.onerror = function () { | |
callback(webP.height === 2); | |
}; | |
}; | |
function notify(supported) { | |
console.log((supported) ? "webP supported!" : "webP not supported."); |
#!/bin/sh | |
# | |
# gunicorn_sr Startup script for gunicorn for sr | |
# | |
# chkconfig: - 86 14 | |
# processname: gunicorn | |
# pidfile: | |
# description: Python application server in ubuntu | |
# | |
### BEGIN INIT INFO |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
{ | |
"bold_folder_labels": true, | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/Color Scheme - Default/Blackboard.tmTheme", | |
"fade_fold_buttons": false, | |
"file_exclude_patterns": | |
[ | |
"*.xlsx", | |
"*.pyc", | |
"*.directory" |
A pure HTML/ CSS responsive organization chart with departments and sub-sections
Improvements: