Skip to content

Instantly share code, notes, and snippets.

View soruly's full-sized avatar
🐈
にゃー

ソ瑠璃(soruly) soruly

🐈
にゃー
View GitHub Profile

Keybase proof

I hereby claim:

  • I am soruly on github.
  • I am soruly (https://keybase.io/soruly) on keybase.
  • I have a public key whose fingerprint is 3577 2760 A073 1049 70F1 2623 21BC D176 57C0 E4EB

To claim this, I am signing this object:

@soruly
soruly / compre.py
Last active June 15, 2023 14:38
Compare two images using OpenCV and SIFT in python
import cv2
import sys
import os.path
import numpy as np
def drawMatches(img1, kp1, img2, kp2, matches):
rows1 = img1.shape[0]
cols1 = img1.shape[1]
rows2 = img2.shape[0]
@soruly
soruly / Scripts.md
Last active May 29, 2020 14:29
Various scripts for demo

Various scripts for demo

parallel-ping.go

Ping a few IP address in parallel with Go routine

sanitize-filename.sh

Check malformed filenames and rename with _

post_to_facebook_group.sh

Post a message to facebook group in shell script using HTTPie and jq

@soruly
soruly / LireRequestHandler.java
Last active April 2, 2018 08:53
Various scripts that I used for whatanime.ga
/*
* This file is part of the LIRE project: http://www.semanticmetadata.net/lire
* LIRE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* LIRE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@soruly
soruly / javascript-practice.md
Created April 1, 2021 06:58
Javascript Practice

Javascript Practice

Why?

  • Able to spot programming mistakes merely by reading code

  • Stop the try-and-error approach in programming (it works ≠ it is correct)

  • Improve instincts to what is the root cause of bugs

  • Speed up time for code review

  • Why?

  • Exercise 1: if(true)

@soruly
soruly / printscreen.ps1
Last active July 26, 2022 03:39
take screenshot of desktop every 15 seconds
Add-Type -AssemblyName System.Drawing
$timer = New-Object timers.timer
$timer.Interval = 15000
$timer.Enabled = $true
$timer.start()
Register-ObjectEvent -InputObject $timer -EventName Elapsed -SourceIdentifier PrintScreen -Action {
$folderName = Get-Date -Format "yyyy-MM-dd"
$fileName = "$(Get-Date -Format "yyyy-MM-dd HH mm ss").jpg"
@soruly
soruly / .env
Last active October 8, 2022 09:09
TELEGRAM_TOKEN= # e.g. 111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
TELEGRAM_WEBHOOK= # e.g. https://your.host.com/
PORT= # (optional) Default: 3000
NOVELAI_TOKEN= # e.g. "Bearer eyJhbxxxxxxxxxxxxxXVCJ9.eyJpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbi9I"
@soruly
soruly / analyze.js
Created December 23, 2022 14:30
script to put ffprobe info to trace.moe api database
import "dotenv/config.js";
import child_process from "child_process";
import cluster from "cluster";
import fs from "fs-extra";
import Knex from "knex";
const { ANIME_PATH, DB_NAME, DB_USER, DB_PASS, DB_HOST } = process.env;
const knex = Knex({