This file contains 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
import base64 | |
import hashlib | |
import hmac | |
from Crypto.Cipher import AES | |
key = base64.decodebytes(b'v4QC6l4ttEogiBYvjLyvbA==') | |
nonce = base64.decodebytes(b'3iNVHJXuCfYoU9QP49DGqw==') | |
ct = base64.decodebytes(b'x9WM3Qy15Xw/2Z6pGVKXVA==') |
This file contains 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
import sys | |
import subprocess | |
from time import sleep | |
cmd = ['top', '-l 0'] | |
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
for line in iter(p.stdout.readline, b''): |
This file contains 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
from sys import stdout | |
from time import sleep | |
for i in range(1,20): | |
stdout.write("\r%d" % i) | |
stdout.flush() | |
sleep(1) | |
stdout.write("\n") # move the cursor to the next line |
This file contains 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
###################################### | |
# Format Options | |
###################################### | |
# The date_format variable followed by a space, specifies | |
# the log format date containing any combination of regular | |
# characters and special format specifiers. They all begin with a | |
# percentage (%) sign. See `man strftime` | |
# | |
#Any Apache log date format |
This file contains 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
let blacklists = ["https://mail.google.com/* gi gt x r f"] | |
map H scrollLeft | |
map L scrollRight | |
map h previousTab | |
map l nextTab | |
map r reloadTabUncached | |
map u lastClosedTab | |
map R :restore<Space> | |
map , goBack |
This file contains 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 python3 | |
import random | |
import signal | |
import sys | |
"""帮助 | |
输入 ? 显示正确答案 | |
""" | |
TEST_COUNT = 0 |
This file contains 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 textToHTML(text) { | |
return ((text || "") + "") // make sure it's a string; | |
.replace(/&/g, "&") | |
.replace(/</g, "<") | |
.replace(/>/g, ">") | |
.replace(/\t/g, " ") | |
.replace(/ /g, "​ ​") | |
.replace(/\r\n|\r|\n/g, "<br />"); | |
} |
This file contains 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
/* Smoke system for pipe --------------------------------------------------------*/ | |
var NUM_PARTICLES = 100 | |
var EMITTER_X = 155 | |
var EMITTER_Y = 120 | |
var MIN_SIZE = 0.1 | |
var MAX_SIZE = 0.3 | |
var MIN_VELOCITY_Y = 0.2 | |
var MAX_VELOCITY_Y = 0.8 | |
var VELOCITY_X = 0 |
This file contains 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
import time | |
class Marsaglia: | |
"""Pseduo-random generator | |
http://www.math.uni-bielefeld.de/~sillke/ALGORITHMS/random/marsaglia-c | |
""" | |
def __init__(self, i1=0, i2=0): | |
self.z = i1 or 362436069 |
This file contains 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
# vim: set fileencoding=utf-8: | |
def incrementString(char): | |
if char.isalpha(): | |
char = char.upper() | |
else: | |
raise ValueError | |
char_len = len(char) | |
ord_list = [ord(s) for s in reversed(char)] |