Skip to content

Instantly share code, notes, and snippets.

Avatar

Xianglong Wu WuXianglong

View GitHub Profile
@WuXianglong
WuXianglong / TextEncoderTextDecoder.js
Created Jul 9, 2020 — forked from Yaffle/TextEncoderTextDecoder.js
TextEncoder/TextDecoder polyfills for utf-8
View TextEncoderTextDecoder.js
// TextEncoder/TextDecoder polyfills for utf-8 - an implementation of TextEncoder/TextDecoder APIs
// Written in 2013 by Viktor Mukhachev <vic99999@yandex.ru>
// To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
// You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
// Some important notes about the polyfill below:
// Native TextEncoder/TextDecoder implementation is overwritten
// String.prototype.codePointAt polyfill not included, as well as String.fromCodePoint
// TextEncoder.prototype.encode returns a regular array instead of Uint8Array
// No options (fatal of the TextDecoder constructor and stream of the TextDecoder.prototype.decode method) are supported.
View Percentage_Circle2.html
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CSS Percentage Circle</title>
<style>
@import url("https://fonts.googleapis.com/css?family=Titillium+Web:200,200i,300,300i,400,400i,600,600i,700,700i,900");
body {
font-family: "Titillium Web", sans-serif;
margin: 0 auto;
}
View Percentage_Circle.html
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CSS Percentage Circle</title>
<style>
@import url("https://fonts.googleapis.com/css?family=Titillium+Web:200,200i,300,300i,400,400i,600,600i,700,700i,900");
body {
font-family: "Titillium Web", sans-serif;
margin: 0 auto;
}
@WuXianglong
WuXianglong / circle_bar.html
Last active Oct 23, 2019
Progress bar Circle using HTML5 and CSS3
View circle_bar.html
<html>
<header>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Lato:700);
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
View 爬虫
# -*- coding: utf-8 -*-
import bs4
import requests
BASE_URL = 'http://bjcme.haoyisheng.com/beijing_project/listProjectGongbu.jsp'
CONTENT_URL = 'http://bjcme.haoyisheng.com/beijing_project/projectGongbuList.do?d-1342871-p=1&beian=&orderBy=subject&pici=&pageSize=10&parentSubjectId=&sdanwei=&type=&xmanager=&gongbu=3&gongbuCode=&subjectId=&name=&scode=&year=2017'
TEACHER_URL = 'http://bjcme.haoyisheng.com/beijing_project/projectTeacherList.do?requestType=PRINT&id=%s'
def get_content():
@WuXianglong
WuXianglong / android_pkg_name_validate.js
Created Nov 18, 2015
Regex to validate Android Package Name
View android_pkg_name_validate.js
var pattern = /^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+[0-9a-z_]$/i;
[
"me.unfollowers.droid",
"me_.unfollowers.droid",
"me._unfollowers.droid",
"me.unfo11llowers.droid",
"me11.unfollowers.droid",
"m11e.unfollowers.droid",
"1me.unfollowers.droid",
@WuXianglong
WuXianglong / .mongorc.js
Created May 22, 2015
个性化Mongo Client
View .mongorc.js
print(" *** 努力实践mongodb,佛祖保佑!*** \n")
lis = new Array(
" _oo8oo_",
" o8888888o",
' 88" . "88',
' (| -_- |)',
' 0\\ = /0',
' ___/'==='\\___',
" .' \\\| |// '.",
" / \\\||| : |||// \\",
@WuXianglong
WuXianglong / gprof2dot.py
Last active Dec 18, 2017
Generate a dot graph from the output of several profilers.
View gprof2dot.py
#!/usr/bin/env python
#
# Copyright 2008-2014 Jose Fonseca
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
View simDHT.py
#!/usr/bin/env python
# encoding: utf-8
import socket
from hashlib import sha1
from random import randint
from struct import unpack
from socket import inet_ntoa
from threading import Timer, Thread
from time import sleep