Skip to content

Instantly share code, notes, and snippets.

View linnchord's full-sized avatar

linnchord linnchord

  • Hangzhou China
View GitHub Profile
@linnchord
linnchord / parser4clashTDY.yaml
Last active June 20, 2022 07:15
yaml profiles parser of clash for TDY clash service to filter "10x 20x" proxy
# Clash win desktop op
# Settings > Profiles > Parsers > Edit
# => copy & past & update the {{token url}} & close & update subscribe
parsers: # array
- url: {{ you tdy token url https://subscribe.*** }}
yaml:
prepend-rules:
- 'DOMAIN-SUFFIX,epicgames.com,POTATO CLOUD'
- 'DOMAIN-SUFFIX,epicgames.dev,POTATO CLOUD'
- 'DOMAIN-SUFFIX,microsoft.com,POTATO CLOUD'
@linnchord
linnchord / get_dict_val.py
Last active December 19, 2015 05:49
Get the deep layer value of dict.
def get_dict_val(keys, dic, spliter='.'):
"""
get deep value of dict
etc:
get_dict_val('a.b.c', {'a':{'b':{'c':123}}}) # 123
@keys: dict key list
@dic: dict object
@spliter: keys spliter default is '.'
class DictProxyObject(dict):
"""Container object for datasets: dictionary-like object that
exposes its keys as attributes."""
def __init__(self, **kwargs):
dict.__init__(self, kwargs)
self.__dict__ = self
@linnchord
linnchord / js_template_sample.html
Created July 12, 2012 02:24
js template sample
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script id="editor_upload_progress_tmpl" type="html/template">
<div id="uploading_bar" class="loading-bar">
<div class="progress progress-info progress-striped">
<div class="bar" style="width:<%=percent%>%;"><%=percent%>% (<%=curFile%>/<%=fileCount%>)</div>
</div>
</div>
@linnchord
linnchord / RedisSessionStore.py
Created August 18, 2011 16:34
Flask session by Redis with pickle
# -*- coding:utf-8 -*-
"""
lib/RedisSessionStore.py
~~~~~~~~~~~~~~
Flask 0.7, session store in redis
ref by https://gist.github.com/994937