Skip to content

Instantly share code, notes, and snippets.

@jz5
jz5 / Program.cs
Last active April 12, 2020 13:55
class Program
{
static void Main(string[] args)
{
var titles = GetTitles("Category:日本語の姓");
File.WriteAllText("日本語の姓.txt", string.Join("\r\n", titles), Encoding.UTF8);
}
private static List<string> GetTitles(string cmtitle)
{
var apng = new APNG("a.png");
if (apng.IsSimplePNG)
PngImage.Source = BitmapFrame.Create(
apng.DefaultImage.GetStream(), BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
else
apng.ToAnimation().CreateStoryboardFor(PngImage).Begin(PngImage);
<Image Name="PngImage" />
var apng = new APNG("a.png");
var bitmaps = apng.ToBitmapSources();
// Save to PNG files
foreach (var (bitmap, index) in bitmaps.Select((item, index) => (item, index)))
{
using (var fileStream = new FileStream($"{index}.png", FileMode.Create))
{
var encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bitmap));
@jz5
jz5 / script.js
Last active November 11, 2018 14:28
const timer = setInterval(timer_tick, 500);
var prevId;
var div = document.createElement("div");
var body = document.getElementsByTagName("body")[0];
body.appendChild(div);
function timer_tick() {
var result = document.documentElement.innerHTML.match(/assetstore_package_(\d+)/);
if (!result) return;
@jz5
jz5 / manifest.json
Last active September 9, 2018 15:44
{
"name": "Show Asset Widget",
"version": "1.0",
"manifest_version": 2,
"description": "Show Unity asset widget on Unity Affiliate reporting page.",
"content_scripts": [
{
"matches": [
"https://console.partnerize.com/v2/reporting/perform",
"https://console.partnerize.com/v2/reporting/performance"
/**********************************************************
Save as PNGs.jsx
DESCRIPTION
This sample gets files specified by the user from the
selected folder and batch processes them and saves them
as PNGs in the user desired destination with the same
file name.
<?php
$connectstr_dbhost = '';
$connectstr_dbname = '';
$connectstr_dbusername = '';
$connectstr_dbpassword = '';
foreach ($_SERVER as $key => $value) {
if (strpos($key, "MYSQLCONNSTR_") !== 0) {
continue;
}
using System;
using System.Collections.Generic;
using System.Globalization;
public class IrohaComparer : IComparer<string>
{
private string iroha = "ィィぃイイいロロろハハはバばパぱニニにホホほボぼポぽヘヘへベべペぺトトとドどチチちヂぢリリりヌヌぬルルるヲヲをヺヮゎワワわヷヵゕカカかガがョョょヨヨよタタたダだレレれソソそゾぞッッっツツつヅづネネねナナなララらムムむゥゥぅウウうヴゔヰゐヸノノのォォぉオオおククくグぐャャゃヤヤやママまヶゖケケけゲげフフふブぶプぷココこゴごェェぇエエえテテてデでァァぁアアあササさザざキキきギぎュュゅユユゆメメめミミみシシしジじヱゑヹヒヒひビびピぴモモもセセせゼぜススすズずンンん";
public int Compare(string x, string y)
{
class Program
{
static void Main(string[] args)
{
var names = new[] {
"あさみ りな",
"なみき なおと",
"いで なおと",
"はなおか なつき",
"まつうら やすふみ",