This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Adblock Plus 2.0] | |
! Title: shuji's list | |
! Last modified: 13 April 2014 21:58 CST | |
! Expires: 1 days (update frequency) | |
! Homepage: https://gist.github.com/Shu-Ji/ | |
!-------based on ChinaList+EasyList----------! | |
www.baidu.com###bottom_container | |
www.baidu.com###u_sp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thrift -r --gen cpp xxx.thrift | |
thrift -r --gen java xxx.thrift | |
thrift -r --gen py xxx.thrift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: u8 | |
import urllib2 | |
import urllib | |
import cookielib | |
class Net(object): | |
def __init__(self, cookie_path=None, encoding='u8', timeout=120, | |
proxy_host=None, proxy_port=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-checkbox/paper-checkbox.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../paper-item/paper-item.html"> | |
<link rel="import" href="../topeka-elements/category-images.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-icons/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> | |
<polymer-element name="my-element"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: u8 | |
import datetime | |
import json | |
_dumps = json.dumps | |
def dumps(obj, *args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jinja2 import nodes | |
from jinja2.ext import Extension | |
class FragmentCacheExtension(Extension): | |
'''http://jinja.pocoo.org/docs/dev/extensions/#example-extension''' | |
# 其余部分略... | |
def _cache_support(self, name, timeout, caller): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- index.jade | |
{% macro cache() %} | |
script. | |
{% if DEBUG %} | |
dg.static_url = { | |
vendor: '{{ static_url("vendor/vendor.js") }}', | |
'common/app.js': "{{ static_url('sanhaolu/default/common/app.js') }}", | |
'pages/404.html': "{{ static_url('sanhaolu/default/pages/404.html') }}" | |
}; | |
{% else %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main.coffee | |
require.config | |
baseUrl: '/static' | |
paths: | |
vendor: dg.static_url['vendor'] | |
# 其他配置略.... | |
deps: [ | |
dg.static_url['common/app.js'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
'angularAMD', | |
dg.static_url['common/services.js'], | |
dg.static_url['common/filters.js'] | |
], (angularAMD) -> | |
sanhaolu = angular.module('sanhaolu', [ | |
'ngRoute', | |
'sanhaolu.common.services', | |
'sanhaolu.common.filters' | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@sched_base.scheduled_job('interval', minutes=1 if settings.DEBUG else 5) | |
def expire_cached_static_files_hash(): | |
u"""当有静态文件发生变化时,使redis中缓存的hash值失效""" | |
import re | |
p = r'?v=([a-f0-9]{32})' | |
html = str(g.render.macro('default/index.html').cache()) | |
hashes_now = sorted(re.findall(p, html) or []) |
OlderNewer