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
# Q-Search | |
# Modified by nzw9314 | |
# From Neurogram (https://raw.githubusercontent.com/Neurogram-R/Surge/master/module/Q-Search.sgmodule) | |
# - Safari 内输入 命令 + 空格 + 关键词 快速指定搜索引擎搜索 | |
# 注:先进入设置更改 Safari 默认搜索为 DuckDuckGO | |
# 可自行修改指令或者添加搜索引擎 | |
# gh: GitHub搜索 | |
# gm: Google图片搜索 | |
# sof: Stack Overflow |
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 | |
function pre_print_r($var){ | |
echo "<pre>"; | |
print_r($var); | |
echo "</pre>"; | |
} | |
function Bigrams($word){ |
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 PROXY_DIRECT = "DIRECT"; | |
var DIRECT = "DIRECT"; | |
var BLACK = "PROXY 8.8.8.8:53"; | |
var WHITE = PROXY_DIRECT; | |
function s(u, r) { | |
return shExpMatch(u, r); | |
} | |
function d(h, r) { |
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
""" .vromerc example file | |
" Note: sync with wiki | |
" Change key mapping in normal mode, please check Vrome Features for available key mapping | |
map j <C-f> | |
map j 10j | |
map k 10k | |
" Remove key mapping in normal mode | |
" unmap <C-f> |
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 xpath_query = '//ul/li/a'; | |
var xpath_obj = document.evaluate(xpath_query ,document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); | |
var href_list = []; | |
for (var m=0; m<xpath_obj.snapshotLength; m++){ | |
href_list[m] = xpath_obj.snapshotItem(m).getAttribute("href"); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link type='text/css' rel='stylesheet' href='style.css'/> | |
<title>More Coin Flips</title> | |
</head> | |
<body> | |
<p>We will keep flipping a coin as long as the result is heads!</p> | |
<?php | |
$flipCount = 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
<!doctype html> | |
<html> | |
<head> | |
<title>D3 tutorial</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
</head> | |
<body> | |
<p> This a paragraph</p> | |
<script> | |
d3.json("./data.json",function(data){ |
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
library(XML) | |
#获取当前链接的所有评论 | |
get_one_page_comment<-function(url){ | |
html<-htmlParse(url) | |
resnodes<-getNodeSet(html,"//div[@class='review-sec']//div[@class='inner']//div[@class='body']//p[@class='read']//span[@class='read-more']//a[@class='cmn-viewmore']") | |
#获取当前页面中所有comment的长文链接 | |
comments_url<-NULL | |
if(is.null(resnodes)){ |
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 | |
//php中php_array(1,$arr)只能查找出数组中第一次出现的$tofind; | |
$arr = array(1,2,3,4,1,1,1,1); | |
var_dump(array_search_all($arr,3)); | |
//返回 value符合的key所组成的数组; | |
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 | |
function pre_print_r($var){ | |
echo "<pre>"; | |
print_r($var); | |
echo "</pre>"; | |
echo "<br />"; | |
} | |
/* | |
http://www.w3school.com.cn/php/func_array_splice.asp |
NewerOlder