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 s = document.createElement("script"); | |
s.src = "https://unpkg.com/[email protected]/dist/jsoneditor.min.js"; | |
document.getElementsByTagName("body")[0].appendChild(s); | |
var b = document.createElement("link"); | |
b.rel = "stylesheet"; | |
b.type = "text/css"; | |
b.href = "https://unpkg.com/[email protected]/dist/jsoneditor.min.css"; | |
document.getElementsByTagName("body")[0].appendChild(b); | |
function getJSON() { |
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
let synth; | |
let voice; | |
let attempts = 0; | |
function loadVoices() { | |
attempts++; | |
const voices = synth.getVoices(); | |
if (voices.length) { | |
voice = voices.find(_voice => /ja[-_]JP/.test(_voice.lang)); | |
} |
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
jQuery(document).ready(function($) { | |
$( ".ss-icon" ).click(function(e) { | |
e.preventDefault() | |
$( ".level1" ).slideToggle( "fast", function() { | |
// Animation complete. | |
}); | |
}); | |
}); |
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 css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return |
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(){ | |
//Get saved items from cookie as string | |
var readedItemsFromCookie = $.cookie('readedItems'), | |
readedItems = [], | |
//Cache links for better performance | |
newlink = $('.new a'); | |
if(readedItemsFromCookie){ | |
//Use split function to convert from saved string to array | |
readedItems = readedItemsFromCookie.split(','); |
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
<?php | |
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <[email protected]> | |
* @copyright Copyright 2012 Sean Murphy. All rights reserved. |
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 | |
import sys, re | |
import argparse | |
from datetime import datetime | |
from urllib import urlopen | |
from BeautifulSoup import BeautifulSoup | |
def main(url): |
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 | |
from twisted.internet import reactor,protocol | |
from twisted.web import proxy,http,client | |
import logging | |
from twisted.web.client import Agent | |
#日志初始化 | |
ServerPort = 9000 | |
logger = logging.getLogger('mylogger') | |
logger.setLevel(logging.DEBUG) |
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
// http://www.ietf.org/rfc/rfc1928.txt | |
// Tested with: curl http://www.google.se/ --socks5 1080 --proxy-user foo:bar | |
var States = { | |
CONNECTED:0, | |
VERIFYING:1, | |
READY:2, | |
PROXY: 3 | |
}; |
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
FFVER=`grep -Po "\d{2}\.\d+" /usr/lib/firefox/platform.ini` | |
ARCH=`uname -p` | |
XURL=https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$FFVER/runtimes/xulrunner-$FFVER.en-US.linux-$ARCH.tar.bz2 | |
cd /opt | |
sudo sh -c "wget -O- $XURL | tar -xj" | |
sudo ln -s /opt/xulrunner/xulrunner /usr/bin/xulrunner | |
sudo ln -s /opt/xulrunner/xpcshell /usr/bin/xpcshell |
NewerOlder