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
#encodeing:utf8 | |
import os | |
try: | |
import netifaces | |
import nmap | |
except ImportError: | |
try: | |
command_to_execute = "pip install netifaces python-nmap || easy_install netifaces python-nmap" |
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
#!/bin/sh | |
path=`pwd` | |
case "$1" in | |
start) | |
echo -n "Starting aria2c" | |
aria2c --conf-path=${path}'/conf/aria2.conf' -D | |
;; | |
stop) |
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 str_rand_scroll(el, time, str) { | |
try { | |
if (el === undefined) throw '没有传入变量el'; | |
try { | |
if (time === undefined) throw '没有传入变量time'; | |
try { | |
if (str === undefined) { | |
// var str = '一乙二十丁厂七卜八人入儿匕几九刁了刀力乃又三干于亏工土士才下寸大丈与万上小口山巾千乞川亿个夕久么勺凡丸及广亡门丫义之尸己已巳弓子卫也女刃飞习叉马乡丰王开井天夫元无云专丐扎艺木五支厅不犬太区历歹友尤匹车巨牙屯戈比互切瓦止少曰日中贝冈内水见午牛手气毛壬升夭长仁什片仆化仇币仍仅斤爪反介父从仑今凶分乏公仓月氏勿欠风丹匀乌勾凤六文亢方火为斗忆计订户认冗讥心尺引丑巴孔队办以允予邓劝双书幻玉刊未末示击打巧正扑卉扒功扔去甘世艾古节本术可丙左厉石右布夯戊龙平灭轧东卡北占凸卢业旧帅归旦目且叶甲申叮电号田由只叭史央兄叽叼叫叩叨'; | |
var str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+' | |
} |
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
// 交换函数 | |
Array.prototype.swap = function (i, j) { | |
[this[j], this[i]] = [this[i], this[j]] | |
} |
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
$(document).click(function() { | |
var a = ['富强', '民煮', '自由', '平等', '友爱', '河蟹', '神马', '香甜']; | |
var v = a[Math.floor(Math.random() * a.length)]; | |
var tips = $('<div style="position:fixed;z-index:9999;color:red;top:200px;left:600px"></div>').text(v).animate({top:'160px'}, 750, function() {$(this).remove()}); | |
$('body').append(tips); | |
}) |
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 w = require('./with.js'); | |
const serveTime = '2017-01-01 00:00:00'; | |
setInterval(()=> { | |
console.log(w.serve(serveTime)); | |
}, 1000); |
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 url = { | |
key: function _get(name, query) { | |
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); | |
if (query) { | |
var r = query.match(reg); | |
} else { | |
var r = window.location.search.substr(1).match(reg); | |
} | |
if (r != null) { | |
return unescape(r[2]); |
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 | |
namespace App; | |
class Config | |
{ | |
private static $name = ''; | |
private static $arr = []; | |
/** | |
* @return array | |
*/ | |
public static function getArr() |
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 | |
/** | |
* 自定义多进制 | |
* @param $str 自定义的多进制字符串 | |
* @param $num 十进制数字 | |
* @return string | |
* @author alexander_phper | |
* @link https://blog.csdn.net/alexander_phper/article/details/51363491 | |
*/ | |
function xbin($str, $num){ |
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 limit_speed_print_file($filename, $limit_rate = 100) | |
{ | |
if (file_exists($filename) && is_file($filename)) { | |
header('Cache-control: private'); | |
header('Content-Type: application/octet-stream'); | |
header('Content-Length: '.get_safe_filesize($filename)); | |
header('Content-Disposition: attachment; filename=' | |
.basename($filename)); | |
header('Content-Transfer-Encoding: binary'); |
OlderNewer