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
body { | |
white-space: pre; | |
font-family: monospace; | |
background-color: #002b36; | |
color: #ddd; | |
} | |
a{ | |
color: green; | |
} |
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
@-moz-document domain("baidu.com") { | |
#u1, | |
#ftCon, | |
#form input, | |
#form span | |
{display: none;} | |
#form::after { | |
font-family: "BlinkMacSystemFont", "Segoe UI", sans-serif; |
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
var ua = (function(){ | |
var ua = {}; | |
var navigator = window.navigator; | |
var platforms = [ | |
{ property: 'platform', regex: /iPhone/i, identity: 'iPhone' }, | |
{ property: 'platform', regex: /iPod/i, identity: 'iPod' }, | |
{ property: 'userAgent', regex: /iPad/i, identity: 'iPad' }, | |
{ property: 'userAgent', regex: /Blackberry/i, identity: 'Blackberry' }, | |
{ property: 'userAgent', regex: /Android/i, identity: 'Android' }, | |
{ property: 'platform', regex: /Mac/i, identity: 'Mac' }, |
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:utf-8 | |
""" | |
CRITICAL = 50 | |
FATAL = CRITICAL | |
ERROR = 40 | |
WARNING = 30 | |
WARN = WARNING | |
INFO = 20 | |
DEBUG = 10 | |
NOTSET = 0 |
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
function checkBrowser(){ | |
var br={} | |
var ua=navigator.userAgent.toLowerCase(); | |
var s; | |
(s = ua.match(/chrome\/([\d.]+)/)) ? br.chrome = s[1] : | |
(s = ua.match(/firefox\/([\d.]+)/)) ? br.firefox = s[1] : | |
(s = ua.match(/msie ([\d.]+)/)) ? br.ie = s[1] : | |
(s = ua.match(/net.*rv:([\d.]+)/)) ? br.ie = s[1] : | |
(s = ua.match(/opera.([\d.]+)/)) ? br.opera = s[1] : | |
(s = ua.match(/version\/([\d.]+).*safari/)) ? br.safari = s[1] : 0; |
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: utf-8 -*- | |
""" | |
命令行版本的有道词典,调用有道翻译的 API 实现 | |
用法一: | |
% python youdao.py search | |
原文: search | |
发音: sɜːtʃ |
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
@-moz-document regexp("https://doc.rust-lang.org/reference.*") { | |
#TOC{ | |
position: fixed; | |
left: 0; | |
top: 0; | |
overflow: scroll; | |
overflow-x: hidden; | |
height: 100vh; | |
max-width: 30vw; | |
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
body {font-family: "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; } | |
#Search div { | |
background-image:none!important; | |
border-image-repeat:repeat; | |
border-image-slice:27 27 27 50; | |
border-image-source:url(https://v2ex.com/static/img/qbar_light@2x.png); | |
border-image-width:27px 27px 27px 50px; | |
width:auto!important; | |
} |
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
class Objectify(object): | |
def __init__(self, data): | |
""" data maybe one dict or list """ | |
self.data = data | |
def __getitem__(self, item): | |
_data = object.__getattribute__(self, 'data') | |
return _data[item] | |
def __getattribute__(self, item): |
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
import qualified Data.Char as C | |
import qualified Data.Map as M | |
import Data.List.Split | |
import Control.Monad | |
quicksort :: (Ord a) => [(k,a)] -> [(k,a)] | |
quicksort [] = [] | |
quicksort ((k,a):xs) = | |
let smallerSorted = quicksort [(x,y) | (x,y) <- xs, y<=a] | |
biggerSorted = quicksort [(x,y) | (x,y) <- xs, y>a] |