Skip to content

Instantly share code, notes, and snippets.

@oonyanya
oonyanya / gist:1b39883a9f847be8131362384c18c7df
Created December 23, 2025 06:43
マルチコア対応、改行コードごとに行を分割するコード
//ForEachLinesの内容ははLineToIndex.csを参照すること
IList<LineToIndexTableData> CreateLineList(long index, long length,bool setdirtyflag = false, int lineLimitLength = -1)
{
const int CoreNum = 4;
const long thresholdParallelCreateList = CoreNum + 1;
//const long thresholdParallelCreateList = 1024 * 1024;
//const long thresholdParallelCreateList = int.MaxValue - 1;
if (length < thresholdParallelCreateList)
{
@oonyanya
oonyanya / html2csv.js
Last active December 2, 2025 05:43
川口市の投票所から投票所名、住所、経度、緯度を取り出すやつ
const links = document.querySelectorAll('#contents-in table tr').forEach((tr)=>{
let datas = tr.querySelectorAll('td p');
if(datas.length == 0)
return;
let address = datas[2].textContent;
let as = tr.querySelectorAll('td p a');
let a = as[0];
let url = a.getAttribute('href');
let text = a.textContent.trim();
str = new URL(url).searchParams.get("ll").split(",");
@oonyanya
oonyanya / gist:d79023f03c4f6f40c0f9158dff94af2a
Created June 24, 2025 13:51
〇〇地図情報の情報一覧からkmlに変換するスクリプト
$inputFile = $Args[0]
$outputFile = $Args[1]
$jsonContent = Get-Content -Raw $inputFile | ConvertFrom-Json
Write-Output '<?xml version="1.0" encoding="UTF-8"?>' | Out-File -Encoding utf8NoBOM -FilePath $outputFile
Write-Output '<kml xmlns="http://earth.google.com/kml/2.0">' | Out-File -Append -Encoding utf8NoBOM -FilePath $outputFile
Write-Output '<Folder>' | Out-File -Append -Encoding utf8NoBOM -FilePath $outputFile
foreach($item in $jsonContent)
{
Write-Output "<Placemark>" | Out-File -Append -Encoding utf8NoBOM -FilePath $outputFile
@oonyanya
oonyanya / get_tsv_from_yahoo.ps1
Created October 12, 2020 12:38
Yahoo株価の時系列からTSVを取得する
[void][Reflection.Assembly]::LoadFile("C:\edgedriver_win32\Selenium.WebDriver.4.0.0-alpha05\lib\net47\WebDriver.dll") #DLL読み込み
$msedge = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" #Edge本体のパス
$msedgedriverDir = "C:\edgedriver_win32" #Edge Driverがあるフォルダのパス
$msedgedriverExe = "msedgedriver.exe" #Edge Driver名
$edgeOptions = New-Object OpenQA.Selenium.Edge.EdgeOptions
$edgeOptions.UseChromium = $true
$edgeOptions.BinaryLocation = $msedge
$service = [OpenQA.Selenium.Edge.EdgeDriverService]::CreateChromiumService($msedgedriverDir, $msedgedriverExe)
$service.EnableVerboseLogging = $false
@oonyanya
oonyanya / add_user.js
Last active October 9, 2020 09:44
twitterのDMグループにユーザーをまとめて追加する奴
getElementsByXPath = function(expression, parentElement) {
var r = []
var x = document.evaluate(expression, parentElement || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null)
for (var i = 0, l = x.snapshotLength; i < l; i++) {
r.push(x.snapshotItem(i))
}
return r
}
//ここにユーザーネームを追加する
##flow
1.get crystal.construct oblisk to front line
2.next few minutes,battle enemy,go to other crystal
3.in some cases, summon warth or knight etc. construct obelisk
please see "how to construct obelisk" or "battle enemy"
please left crystal to a friend.because enemy left three crystal when you is die.
##how to construct obelisk
construct oblisk to front line.
###how to draw front line
@oonyanya
oonyanya / fez_war_download.js
Last active August 29, 2015 14:20
FEZ SNSの戦争データを集める
var FezWarData = (function(){
function FezWarData(){
}
FezWarData.prototype.result = "";
FezWarData.prototype.fetchRecords = function(record_list_url){
console.log(record_list_url);
var d = new $.Deferred();