Skip to content

Instantly share code, notes, and snippets.

class RedisSessionStore(SessionStore):
def __init__(self, expire = 1800, key_prefix=''):
SessionStore.__init__(self)
self.redis = redis.Redis(tools.config.get('redis_host', 'localhost'),
int(tools.config.get('redis_port', 6379)),
int(tools.config.get('redis_dbindex', 1)),
password=tools.config.get('redis_pass', None))
self.path = session_path()
self.expire = expire
self.key_prefix = key_prefix
[add_eventon_el cal_id="10" el_title="UPCOMING PERFORMANCES - 2016" pec="ft" number_of_months="4" fixed_year="2016" show_year="yes"]
[add_eventon_el cal_id="9" el_title="UPCOMING PERFORMANCES - 2017" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2017" number_of_months="12" event_count="90" event_order="ASC"]
[add_eventon_el cal_id="8" el_title="Past Performances - 2016" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2016" number_of_months="8" event_count="90" event_order="DESC"]
[add_eventon_el cal_id="7" el_title="Past Performances - 2015" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2015" number_of_months="12" event_count="90" event_order="DESC" ]
[add_eventon_el cal_id="6" el_title="Past Performances - 2014" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2014" number_of_months="12" event_count="80" event_order="DESC" ]
[add_eventon_el cal_id="5" el_title="Past Performances - 2013" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2013" number_of_months="12" event_count="7
@skygunner
skygunner / windows.conf
Last active July 11, 2016 13:53 — forked from anonymous/windows.conf
windows 10 doesn't have network status/properties after upgrade from 7/8 (has WIFI and showing AP, but can't connet ), no WIFI, no network, no internet
My thinkpad has this problem. So
Step 1:
check if wlan auto config service is running and set to auto;
Step 2:
delete all vpn client software
delete all vpn adapter and its drivers
reboot
Step 3:
@skygunner
skygunner / remote-image-cache.php
Created July 5, 2016 21:43 — forked from ScottPhillips/remote-image-cache.php
Cache remote image using PHP
<?php
function cache_image($image_url){
//replace with your cache directory
$image_path = 'path/to/cache/dir/';
//get the name of the file
$exploded_image_url = explode("/",$image_url);
$image_filename = end($exploded_image_url);
$exploded_image_filename = explode(".",$image_filename);
$extension = end($exploded_image_filename);
//make sure its an image
@skygunner
skygunner / build_nginx.sh
Created July 5, 2016 19:13 — forked from Belphemur/build_nginx.sh
Compiling Nginx with LibreSSL (and http2)
#!/usr/bin/env bash
# names of latest versions of each package
export NGINX_VERSION=1.11.1
export VERSION_PCRE=pcre-8.38
export VERSION_LIBRESSL=libressl-2.4.1
export VERSION_NGINX=nginx-$NGINX_VERSION
#export NPS_VERSION=1.9.32.10
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta
@skygunner
skygunner / README.md
Created April 6, 2016 00:34 — forked from e7d/README.md
[Debian] Build a Squid transparent proxy from source code
@skygunner
skygunner / cls_template.php
Last active September 16, 2015 05:57 — forked from wudi/cls_template.php
ECshop preg_replace /e 修饰符修复(本文件可直接替换2.7.3)
<?php
/**
* ECSHOP 模版类
* ============================================================================
* * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。