Skip to content

Instantly share code, notes, and snippets.

View skysan87's full-sized avatar

skysan skysan87

  • Japan
View GitHub Profile
@skysan87
skysan87 / copy.bat
Created September 25, 2019 07:52
[PowerShell] コピー先のファイル名を指定して、複数個複製するパッチ
REM Drag-and-Drop target file.
powershell -ExecutionPolicy Unrestricted -File %~dp0\copy_file_with_list.ps1 %~dp0\filelist.txt %*
@skysan87
skysan87 / manifest.json
Last active July 24, 2019 05:33
[Chrome拡張] 表示しているページのタイトルとURLをmarkdown形式でクリップボードへコピー
{
"manifest_version": 2,
"name": "markdown_url",
"version": "1.0.0",
"description": "format the page link as markdown",
"background": {
"scripts": ["script.js"],
"persistent": false
@skysan87
skysan87 / ruby.json
Last active July 22, 2019 01:22
VisualStudioCode Ruby Snippets for RSpec
{
"it syntax": {
"prefix": "it",
"body": [
"it '$1' do",
"\t$0",
"end"
]
},
"describe syntax": {
@skysan87
skysan87 / progress.cs
Created May 30, 2019 00:34
[C#]コンソールで進捗表示
class Program
{
static void Main(string[] args)
{
Console.WriteLine("start");
string output = "";
for (int i = 0; i < 5; i++)
{
System.Threading.Thread.Sleep(1000);
@skysan87
skysan87 / match_pattern.cs
Last active June 4, 2019 14:55
[C#] 正規表現サンプル
private bool isMatch(string input)
{
// 英字小文字、大文字、数字を1つずつ含み、8文字以上(記号は含まない)
var pattern = @"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,}$";
// NOTE:記号を含む場合、ASCII表記の方が楽かも[\x21-\x7e]
return Regex.IsMatch(input, pattern);
}
@skysan87
skysan87 / BitFlagTest.cs
Last active March 16, 2019 14:07
[C#]フラグ(ビット演算とEnum)
class BitFlagTest : IFlagTest
{
// ビットシフトで表記
const int flag1 = 1 << 0; //2進数:001 10進数:1 16進数:0x1;
const int flag2 = 1 << 1; //2進数:010 10進数:2 16進数:0x2;
const int flag3 = 1 << 2; //2進数:100 10進数:4 16進数:0x4;
int flag = 0;
public void AllFlags_On()
@skysan87
skysan87 / Program.cs
Last active January 22, 2019 13:53
Split text using by Regular-Expressions
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace sampleapp_csharp
{
class Program
{
// 正規表現で取得した文字列で分割する
static void Main(string[] args)
@skysan87
skysan87 / countdown.bat
Last active January 23, 2019 00:24
カウントダウンタイマー
@echo off
rem 実行環境: Windows 7 x64(日本語環境)
rem 留意事項:文字コード:UTF-8(BOMなし)、日本語は文字化けする
rem 環境を汚染しないようにローカル化
setlocal
rem タイトル変更
title Countdown Timer
@skysan87
skysan87 / note.md
Created December 8, 2018 13:41
Python v2->v3 アップデート

実行環境

  • macOS Mojave ver 10.14.1
  • Homebrew 1.8.4
  • Xcode 10.1(10B61)

1. バージョン確認

$ python -V
Python 2.7.10
@skysan87
skysan87 / commonUnit.js
Created November 19, 2018 12:15
ES module 基礎
let day = '日'
let week = '週'
let month = '月'
export {day, week, month}
// 変数の場合defaultは使用できない
export let year = '年'
let dayOfWeek