Skip to content

Instantly share code, notes, and snippets.

View poynt2005's full-sized avatar
🎯
Focusing

紀克勤(瑋) poynt2005

🎯
Focusing
View GitHub Profile
d1fc3a65-6db8-4c31-8aa4-cff1ff29c0d6
REGEDIT4
[HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionFontSubstitutes]
"Arial"="Arial"
"Arial CE,238"="PMingLiU"
"Arial CYR,204"="PMingLiU"
"Arial Greek,161"="PMingLiU"
"Arial TUR,162"="PMingLiU"
"Courier New"="Courier New"
"Courier New CE,238"="PMingLiU"
[system.reflection.assembly]::LoadWithPartialName("System.IO.Compression")
[system.reflection.assembly]::LoadWithPartialName("System.IO.Compression.ZipFile")
$CsCode = @'
using System;
using System.Net;
using System.IO;
using System.IO.Compression;
#include <Napi.h>
#include "TestFunc.h"
#include <functional>
#include <vector>
#include <memory>
#include <unordered_map>
using Handle = unsigned long long;
using Context = struct context
@poynt2005
poynt2005 / findIntersection.js
Created February 22, 2023 07:31
字串尾交集
function findIntersection(str1, str2){
const intersections = [];
var intersection;
let distance = 0;
let patternStart = false;
while(distance <= str1.length - 1){
if(!patternStart){
if(str1[str1.length - 1 - distance] == str2[0]){
let subStr1 = str1.substring(str1.length - 1-distance);
if(str2.indexOf(subStr1) == 0){
var getProgressBar = (function(){
var wm = new WeakMap();
function _getVal(obj, key){
var _obj = wm.get(obj);
if(typeof _obj == 'undefined'){
return undefined;
}
var Recorder = (function(){
var wm = new WeakMap();
function _getVal(obj, key){
var _obj = wm.get(obj);
if(typeof _obj == 'undefined'){
return undefined;
}
return _obj[key];
openssh-server docker
/**
* 在使用electron main進程跟renderer進程時,遇上一個困擾
* 就是如果在主進程必須等待渲染進程的資料才能繼續下一步時,
* 勢必要阻塞主進城的執行順序,等待渲染進程的資料。
* 因ipcMain監聽事件是非同步的,亦即事件的處理方法必須在callback函式裡面處理,
* 所以必須把ipcMain的部分使用Promise進行封裝,才可以有辦法做成同步化,
* 以我的例子中,在主進程使用selenium webdriver,獲取captcha的圖片,
* 等待渲染進程輸入captcha code,由主進程的selenium進行提交,
* 考慮的狀況有:
* 1. 提交第一次,captcha code即驗證無誤,進行下一步驟
FROM alpine:latest AS builder
WORKDIR /root
RUN apk update
RUN apk add curl wget
RUN export BRANCH=$(curl -L http://dl-cdn.alpinelinux.org/alpine | \
grep -E 'v[0-9]+\.[0-9]+' | \
sed -e 's/<[^>]*>//g' -e 's/\/.*//g' | \
sort -V | \