Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
start, end = '1.1.138.0|2.2.138.5'.split('|')
s = [int(x) for x in start.split('.')]
e = [int(x) for x in end.split('.')]
# s.reverse()
# e.reverse()
# print(s, e)
# print(len(s), len(e))
# print(type(s), type(e))
@keulraesik
keulraesik / cocos.py
Created April 18, 2018 01:18 — forked from shuax/cocos.py
import zipfile
import xxtea
import re
import os
# setXXTEAKeyAndSign
apk = zipfile.ZipFile("xxxx.apk", "r")
probe_file = []
var keepDecimalPlacesBy = function (v, dp=2) {
if (isNaN(v * 1)) return v;
v = v.toString();
var parts = v.split('.');
console.log(parts);
if (parts) {
switch (parts.length) {
case 1:
return v;
case 2:
@keulraesik
keulraesik / ASCII.js
Created June 19, 2017 07:36
javascript ascii
function isStringEmpty(str) {
return null == str || ((typeof(str) == "string") && 0 == str.length);
}
/**
* ASCII printable CHAR
*/
function is_printable_ascii_like(text) {
if (isStringEmpty(text)) return false;
return /^[ -~]+$/.test(text);