This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import itertools | |
| def simple_digest(input_string): | |
| chars = {} | |
| for c in input_string: | |
| chars[c] = chars.get(c, 0) + 1 | |
| items = iter(sorted(chars.items())) |
This file contains hidden or 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/bash | |
| which cat &> /dev/null && \ | |
| cat << EOF | |
| ################################################################################ | |
| # AutoBisect Procedure # | |
| # ---------------------------------------------------------------------------- # | |
| # Project: Continuous Integration Toolkit (Travis CI) # | |
| # Author: KaiserKatze # | |
| # # |
This file contains hidden or 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/bash | |
| cat << EOF | |
| #=============================================================================# | |
| # Startup Boot Script # | |
| # --------------------------------------------------------------------------- # | |
| # Platform : Vultr VPS (Debian 9) # | |
| # Author : KaiserKatze <[email protected]> # | |
| # --------------------------------------------------------------------------- # | |
| # This startup script is saved to `/tmp/firstboot.exec` after execution. # |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Project: Inquisitor(异端审判) | |
| Author: KaiserKatze | |
| """ | |
| import requests | |
| import datetime |
This file contains hidden or 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 extractTotalViewFromHtmlResponse(response) { | |
| // TODO | |
| } | |
| // test mid=299999920 | |
| // test mid=6290510 | |
| export class User { | |
| User(mid: number) { | |
| } |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| class Solution: | |
| def __init__(self): | |
| self.array = None | |
| def create_array(self, array_length): | |
| result = [0] * array_length; |
This file contains hidden or 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
| # Travis CI configuration | |
| language: generic | |
| sudo: required | |
| dist: trusty | |
| # DO NOT CACHE DEBIAN PACKAGES | |
| before_install: | |
| - pwd | |
| - git clone --quiet --branch 3.7 --depth 1 --no-tags -- https://github.com/python/cpython cpython-3.7 | |
| - cd cpython-3.7 |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| class Angle: | |
| val = 0 | |
| def __init__(self, x, y, z): | |
| self.val = ((x * 60) + y) * 60 + z | |
| self.x = x |
This file contains hidden or 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/bash | |
| printerr() { echo "$@" 1>&2; } | |
| get_host_ip() { | |
| adapters=$(ip -4 a | awk '/inet/{print $2}' | cut -d'/' -f1) | |
| for adapter in $adapters; | |
| do | |
| # exclude address of loopback interface | |
| if [ "$adapter" == 127.0.0.1 ]; |
This file contains hidden or 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
| # Cook iptables | |
| apt-get -y install build-essential automake libtool | |
| git clone git://git.netfilter.org/iptables | |
| cd iptables | |
| ./autogen.sh | |
| ./configure | |
| make | |
| make install |