Skip to content

Instantly share code, notes, and snippets.

View akkuman's full-sized avatar
💭
I may be slow to respond.

akkuman

💭
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#__author__ == Tr3jer_CongRong
import re
import sys
import time
import threading
import dns.resolver
@akkuman
akkuman / generate_toc.js
Created September 12, 2018 13:43
[生成目录.js] 动态生成h2,h3目录 #javascript
let genToc = function() {
let tor_tree = document.createElement('div');
tor_tree.id = 'torTree';
tor_tree.innerHTML += ' <h4 id="anchor-0">导航树</h4>';
$(":header").each(function(index, element) {
let tag_name = $(this)[0].tagName;
let tag_a_html = '';
if (tag_name == 'H2'||tag_name == 'H3') {
let anchor_text = 'anchor-'+(index+1);
$(this).attr('id', anchor_text);
@akkuman
akkuman / genToc.js
Created September 13, 2018 13:38
[生成目录遍历所有header.js] 遍历所有的header标签生成导航树 #javascript
/**
* Convert item of header array to html in li
* @param item An element of header array
*/
var itemToHtml = function(item) {
return '<a href="#' + item.id + '" id="' + 'menu-'+ item.id + '" >' + item.innerText + '</a>';
};
/**
* Generate tree from header array
* @param toc_list An array containing header elements
@akkuman
akkuman / getwallpaper.py
Created March 12, 2019 04:44
[getwallpaper] get wallpaper from wall.alphacoders.com #crawler #Python
#coding=utf-8
import requests
import re
import os
import sys
proxies = { "http": "http://127.0.0.1:1080", "https": "http://127.0.0.1:1080", }
download_dir = './pic/'
https://press.one/p/v?s=775c91bb575b5b9b241e8fb6b1efcc57bd1acadfeed1b0e45b4d0773e56f544ac935e9cad950873366ba433e1761836e5cadcaf7a3923c71fd315d685b6daeee1&h=677f40477cba754a76d84a7dcd89a87c32f304521b096c5da57059f81986bf6b&a=215a533bd0811973aa26b90c145b73b8822aa33a&f=P1&v=3
var ZCrypt = ZCrypt || {};
ZCrypt.ADD = 0;
ZCrypt.SUB = 1;
ZCrypt.XOR = 2;
ZCrypt.NOT = 3;
ZCrypt.SHIFT = 4;
ZCrypt.ADD_MORPH = 5;
ZCrypt.SUB_MORPH = 6;
ZCrypt.XOR_MORPH = 7;
ZCrypt.NEG = 8;
@akkuman
akkuman / getTextFromPDF.go
Created April 2, 2020 09:10
获取pdf中的文字
package main
import (
"fmt"
"os"
"github.com/ledongthuc/pdf"
)
func main() {
@akkuman
akkuman / arecord.go
Created April 30, 2020 07:28
golang官方dns解析与只解析a记录的差距
package main
import (
"context"
"fmt"
"net"
"time"
"github.com/miekg/dns"
)
@akkuman
akkuman / dingscan.html
Created May 29, 2020 10:20
钉钉扫码前端demo
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script>
<!--[if IE]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
@akkuman
akkuman / execute_command.c
Created June 15, 2020 05:18
c语言执行命令获得返回
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int exec_command(char* command, char* out);
int main( int argc, char *argv[] ) {
char *tmp_buf = malloc(1025);
char result[4097] = { 0 };
strcpy(tmp_buf, argv[1]);