Skip to content

Instantly share code, notes, and snippets.

View flxxyz's full-sized avatar
🙏
happening

一个不知名の睡觉高手 flxxyz

🙏
happening
View GitHub Profile
@flxxyz
flxxyz / ip_scan_nmap.py
Created January 6, 2018 11:37
nmap插件扫描本地ip段内在线的机器
#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"
@flxxyz
flxxyz / aria2c.sh
Created January 6, 2018 11:39
aria2c自建管理脚本
#!/bin/sh
path=`pwd`
case "$1" in
start)
echo -n "Starting aria2c"
aria2c --conf-path=${path}'/conf/aria2.conf' -D
;;
stop)
@flxxyz
flxxyz / function.js
Last active January 11, 2018 03:08
预定义字符串,随机打乱成新字符串滚动,控制运行时间
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!@#$%^&*()_+'
}
@flxxyz
flxxyz / base.js
Last active April 22, 2020 09:51
常见js排序算法,内置函数sort()除外
// 交换函数
Array.prototype.swap = function (i, j) {
[this[j], this[i]] = [this[i], this[j]]
}
@flxxyz
flxxyz / click_str.js
Created June 29, 2018 09:31
点击网页随机出现预设的文字
$(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);
})
@flxxyz
flxxyz / example.js
Created July 6, 2018 12:23
javascript简易时间处理类
var w = require('./with.js');
const serveTime = '2017-01-01 00:00:00';
setInterval(()=> {
console.log(w.serve(serveTime));
}, 1000);
@flxxyz
flxxyz / url_query_str.js
Created July 7, 2018 10:35
javascript自用简易获取url参数
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]);
@flxxyz
flxxyz / Config.php
Last active July 7, 2018 10:47
自用简易控制器
<?php
namespace App;
class Config
{
private static $name = '';
private static $arr = [];
/**
* @return array
*/
public static function getArr()
@flxxyz
flxxyz / xbin.php
Last active July 13, 2021 12:18
自定义多进制很骚
<?php
/**
* 自定义多进制
* @param $str 自定义的多进制字符串
* @param $num 十进制数字
* @return string
* @author alexander_phper
* @link https://blog.csdn.net/alexander_phper/article/details/51363491
*/
function xbin($str, $num){
@flxxyz
flxxyz / limit_speed_print_file.php
Last active August 28, 2018 16:15
限制文件读取速度
<?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');