This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import codecs | |
import glob | |
import re | |
import os | |
# 上限ファイル数 (適宜変更) | |
limit = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
namespace System | |
{ | |
public static class DateTimeExtensions | |
{ | |
/// <summary> | |
/// 指定した日付を "yyyyMMdd" 形式で返します。 | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class App | |
{ | |
public App() | |
{ | |
PrepareEUDCFont(); | |
} | |
/// <summary> | |
/// 外字フォントを Window のデフォルトフォントに追加します。 | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div ref="wrapper" class="fd__wrapper"> | |
<input type="hidden" :name="name" :value="value"> | |
<input ref="textBox" type="text" class="fd__display-textbox" :disabled="disabled" | |
:value="displayText" :placeholder="placeholder" readonly="readonly" @click="textBoxClicked"> | |
<div class="fd__list" v-show="showList"> | |
<div class="fd__filter-input"> | |
<input ref="filterTextBox" type="text" class="fd__filter-textbox" placeholder="Filter..." v-model="filterString"> | |
</div> | |
<ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const string PWS_CHARS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
/// <summary> | |
/// 指定した長さの文字からなるランダムなパスワードを返します。 | |
/// </summary> | |
/// <param name="length">生成するパスワードの長さ</param> | |
/// <param name="availableChars">使用可能な文字の一覧</param> | |
/// <returns>生成されたパスワード</returns> | |
public static string GenerateRandomPassword(int length, string availableChars = PWS_CHARS) | |
{ | |
if (string.IsNullOrEmpty(availableChars)) availableChars = PWS_CHARS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const AWS = require('aws-sdk'); | |
// EC2 インスタンスを起動する | |
function startEC2Instance(region, instanceId) { | |
const ec2 = new AWS.EC2({ region: region }); | |
const params = { | |
InstanceIds: [instanceId], | |
DryRun: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes; | |
namespace YourApplication | |
{ | |
internal class LocalizedCategoryAttribute : CategoryAttribute | |
{ | |
public LocalizedCategoryAttribute(string resourceKey) | |
: base(LocalizedResources.GetString(resourceKey)) { } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.CompilerServices; | |
/// <summary> | |
/// 環境変数を管理します。 | |
/// </summary> | |
public static class Env | |
{ | |
/// <summary> | |
/// デフォルトの .env ファイルのファイル名 | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .NET 5 まで | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
public static class StringExtensions | |
{ | |
static readonly SHA256CryptoServiceProvider hashProvider = new SHA256CryptoServiceProvider(); | |
public static string GetSHA256HashedString(this string value) | |
=> string.Join("", hashProvider.ComputeHash(Encoding.UTF8.GetBytes(value)).Select(x => $"{x:x2}")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
/// <summary> | |
/// Provides iterators to read lines in a file. | |
/// </summary> | |
public static class TextFile | |
{ | |
/// <summary> |
OlderNewer