Skip to content

Instantly share code, notes, and snippets.

@huiliu
huiliu / iap.py
Created October 9, 2019 08:58
In-App Purchase
import requests
import json
from transactionTable import TransactionTable
class IAP(object):
@staticmethod
def url(debug=True):
if debug:
import android.app.Application;
import com.kochava.base.Tracker;
import com.kochava.base.Tracker.Configuration;
public class KochavaBridge {
static void setGUID(String guid){
Tracker.configure(new Configuration(null));
}
static void setUserId(String uid){
@huiliu
huiliu / zhihu.ts
Last active August 2, 2021 14:47
import puppeteer, { Page, Browser } from "puppeteer-core"
import axios from "axios";
import { stat } from "fs";
export default class Main {
static userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36";
static selector = "div.item:nth-child(1) > div"
static exePath = "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe";
static async runTest(): Promise<any> {
// let exePath = "/usr/bin/chromium";
@huiliu
huiliu / ss.py
Created July 3, 2019 01:22
sock5
import logging
import select
import socket
import struct
from socketserver import ThreadingMixIn, TCPServer, StreamRequestHandler
logging.basicConfig(level=logging.DEBUG)
SOCKS_VERSION = 5
@huiliu
huiliu / transparent.py
Created November 13, 2018 09:34
将png图片中的指定颜色设置为透明
# 将图片中的指定颜色设置为透明
# 运行于python3.7 Pillow5.3
import sys
from PIL import Image
def Convert(fileName):
image = Image.open(fileName)
img = image.convert("RGBA")
@huiliu
huiliu / Graph.cs
Created November 12, 2018 03:28
一个小游戏的图遍历方法
namespace NewImplement
{
// 图遍历的问题
public class GraphNode
{
public int ID { get; private set; }
private HashSet<int> Successors = new HashSet<int>();
public GraphNode(int id)
{
@huiliu
huiliu / MoveAroundCycle.cs
Created August 4, 2018 08:57
Unity3d控制移动方向做圆周运动
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Move
: MonoBehaviour
{
[SerializeField] private Vector3 Anchor;
[SerializeField] private float Radius;
@huiliu
huiliu / SlicedImage.cs
Last active May 30, 2018 21:04
九宫格形式拉伸贴图
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Sprites;
public class ChildImage : Image{
protected override void OnPopulateMesh(VertexHelper toFill)
{
@huiliu
huiliu / connection.cs
Created September 9, 2017 10:24
xxxx
using System;
using System.Collections.Generic;
using System.Net;
using System.IO;
using System.Net.Sockets;
using System.Diagnostics;
using System.Threading;
using YezhStudio.Base;
@huiliu
huiliu / ringbuffer.cpp
Last active August 20, 2017 08:37
RingBuffer.cpp
#include "stdafx.h"
#include <iostream>
#include <cassert>
#include <memory>
#include <tuple>
typedef char* CharSPtr;
class RingBuffer
{