Skip to content

Instantly share code, notes, and snippets.

View shiguruikai's full-sized avatar

shiguruikai shiguruikai

View GitHub Profile
@shiguruikai
shiguruikai / index.js
Last active May 3, 2025 13:59
CORS Proxy server for Google Cloud Run functions
const functions = require('@google-cloud/functions-framework');
const compression = require('compression');
const express = require('express');
const app = express();
app.use(compression());
app.disable('x-powered-by');
app.all('/', async (req, res) => {
try {
@shiguruikai
shiguruikai / example.ps1
Created October 21, 2024 14:59
Windowsユーザーの資格情報を使用して暗号化/復号を行うPowerShellのサンプルコード
$rawText = "パスワード"
Add-Type -AssemblyName System.Security
$SALT_LEN = 16 # 128bit
$SALT_BASE64_LEN = 24
function ConvertTo-EncryptedString {
param(
[string]$text
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shiguruikai
shiguruikai / _flex-layout.scss
Created July 24, 2023 05:10
Angular Flex-Layout の代替(すべてを網羅しているわけではありません)
// Angular Flex-Layout の代替
[fxLayout] {
box-sizing: border-box;
display: flex;
}
[fxLayout^='row'] {
flex-direction: row;
}
@shiguruikai
shiguruikai / Create-Dataset.ps1
Last active December 9, 2023 00:16
rvcやsvc用の学習データを作成するためのスクリプト。
# Requires -Version 7.1
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$SrcDir,
[Parameter(Mandatory)]
[string]
@shiguruikai
shiguruikai / Get-Chunk.ps1
Created April 12, 2023 12:27
PowerShellでwindowed関数的なやつ。
[OutputType("System.Array")]
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline)]
[psobject]$InputObject,
[Parameter(Mandatory, Position = 0)]
[int]$Size,
[Parameter()]
@shiguruikai
shiguruikai / CountLines.java
Created January 15, 2023 14:26
Quickly count lines in large files. 大きなファイルの行数を素早く数える。
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
public class CountLines {
private static final int MAX_BUFFER_SIZE = 1024 * 1024;
public static void main(String[] args) throws Exception {
if (args.length < 1) {
@shiguruikai
shiguruikai / uBlacklist.txt
Last active May 27, 2022 08:07
uBlacklistのブラックリスト(自分用)
*://udemy.benesse.co.jp/*
*://www.udemy.com/*
*://www.sejuku.net/*
*://www.pasonatech.co.jp/*
*://tech-camp.in/*
*://career.levtech.jp/*
*://techacademy.jp/*
@shiguruikai
shiguruikai / Microsoft.PowerShell_profile.ps1
Last active March 21, 2023 23:16
自分用のPowerShellプロファイル
# beep音を無効化
Set-PSReadlineOption -BellStyle None
function TextEncodingsArgumentCompleter {
[OutputType([System.Management.Automation.CompletionResult])]
param(
[string] $CommandName,
[string] $ParameterName,
[string] $WordToComplete,
[System.Management.Automation.Language.CommandAst] $CommandAst,
@shiguruikai
shiguruikai / ZipUtils.java
Last active February 28, 2022 13:56
JavaでZIPを圧縮・展開するユーティリティクラス。
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.CREATE_NEW;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
import static java.nio.file.StandardOpenOption.WRITE;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;