Skip to content

Instantly share code, notes, and snippets.

View kw26's full-sized avatar
🙃

kuangwei kw26

🙃
  • ShenZhen, China
View GitHub Profile
class RedisWrapper(object):
"""
https://stackoverflow.com/questions/31663288/how-do-i-properly-use-connection-pools-in-redis
Usage:
r_server = RedisWrapper().redis_connect()
r_server.ping()
"""
shared_state = {}
def __init__(self):
def sign_data(private_key_loc, data):
'''
param: private_key_loc Path to your private key
param: package Data to be signed
return: base64 encoded signature
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
from base64 import b64encode
using System.Runtime.CompilerServices;
using System;
using System.Net;
using System.Net.Sockets;
using System.IO;
public class Script : ScriptBase, System.IDisposable
{
@kw26
kw26 / Program.cs
Created September 17, 2019 02:48 — forked from jamesmanning/Program.cs
simple TCP client and server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
@kw26
kw26 / Program.cs
Created September 17, 2019 02:48 — forked from jamesmanning/Program.cs
simple TCP client and server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
@kw26
kw26 / README.md
Last active September 20, 2019 10:12
ventuz simple tcpclient

ventuz simple tcpclient

inputs
type name
string address
func Connect
@kw26
kw26 / OrderPrinter.html
Created June 8, 2020 12:49
自家餐厅小票打印
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.menubar {
line-height: 36px;