Skip to content

Instantly share code, notes, and snippets.

// 取得頁面上的初始文字
var targetDom = document.querySelector("main");
var initialText = targetDom.innerText;
// 設定一個定時器,定期檢查頁面上的文字是否有變化
setInterval(function() {
// 取得目前的文字
var currentText = targetDom.innerText;
@LewisGet
LewisGet / gmmhmm.py
Created March 9, 2023 06:14 — forked from kastnerkyle/gmmhmm.py
GMM-HMM (Hidden markov model with Gaussian mixture emissions) implementation for speech recognition and other uses
# (C) Kyle Kastner, June 2014
# License: BSD 3 clause
import scipy.stats as st
import numpy as np
class gmmhmm:
#This class converted with modifications from https://code.google.com/p/hmm-speech-recognition/source/browse/Word.m
def __init__(self, n_states):
self.n_states = n_states
let speech = new SpeechSynthesisUtterance();
speech.lang = "en";
speech.text = "hello kit";
speechSynthesis.speak(speech);
/** list pages */
var href_lists = document.querySelectorAll(".spoilerbody")[2].querySelector("td").querySelectorAll("a");
var url_replace = "/files/all?filter-game-version=2020709689%3A6756";
href_lists.forEach(function(v){
v.href = v.href + url_replace;
v.click();
});
FROM openjdk:8
MAINTAINER Lewis
WORKDIR /server
RUN apt update
RUN apt install -y zip unzip htop apache2 openssh-server
import numpy as np
# f(x, y) return this array
data = np.array([
[3, 6, 4, 2],
[1.1, 0.5, 0.1, 0.9],
[4, 0.3, 2.3, 8.9]
])
x = {"1.1": data[0], "4.2": data[1], "-3": data[2]}
# touch at x 534 2212
adb shell input tap 534 2212
# get now screen
adb exec-out screencap -p > screen.png
def wait_and_click(image):
wait(image)
click(image)
def try_execute(try_times, execute_function, fail_execute_function):
for i in range(try_times):
try:
execute_function()
break
except:
@LewisGet
LewisGet / modpack.sh
Created March 30, 2022 07:35 — forked from artheus/modpack.sh
Shell script for downloading mods for Curseforge Modpack on Linux clients (using Vanilla Minecraft Launcher)
#!/bin/bash
## Usage:
## 1. Download the modpack zip from CurseForge
## 2. Extract zip to where you want your modpacks game directory to be (e.g. ~/minecraft/modpack/gamedir)
## 3. In terminal, run this script in your chosen game directory
## If successful, it should print out which mods its downloading, until it is done
## 4. Create an "Installation" in the Vanilla Minecraft Launcher
## * Version should be set to the correct modded minecraf version installed (eg. 1.16.4-forge-35.1.13)
## * Make sure you are running the correct java version, and are giving an appropriate amount of RAM
docker exec 容器id psql 資料庫名稱 -U 使用者 -c "\d"