Skip to content

Instantly share code, notes, and snippets.

@f7q
f7q / GitClone.txt
Created June 17, 2018 15:33
git checkout hash
ExtCore
ExtCore-Sample
Knowledge
learning
SubTreeLearn
WPFLearn
IdentityServer4Authentication
@f7q
f7q / FileStreamResult.md
Created May 30, 2018 13:07
ASP.NET Core MVC Fileダウンロード

HomeController.cs

public IActionResult Download()
{
  var mimeType = "text/xml";
  var xml = @"
<xml>
<var>テスト</var>
</xml>";
 var fileContent = System.Text.Encoding.UTF8.GetBytes(xml);
@f7q
f7q / .gitignore
Last active February 4, 2018 11:21
git clone
.svn/
.vs/
bin/
obj/
*.xproj.user
*.lock.json
artifacts/
tools/
*.nupkg
@f7q
f7q / AppContextFactory.cs
Last active January 15, 2018 21:42
Sample
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Infrastructure;
using OptimicLock.Models;
namespace OptimicLock
{
public class AppDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
{
public AppDbContext CreateDbContext(string[] args)
@f7q
f7q / git_command.sh
Last active January 29, 2018 11:36
git 関連のコマンド
# サブコマンド cd git pull origin master
git -C $(pwd)/learning pull --progress -v --no-rebase "origin"
# サブコマンド cd git checkout master
git -C $(pwd)/learning checkout master --
# 最新をフェッチ
git fetch https://github.com/f7q/learning.git
# ミラーリング
cd ..
git clone --mirror https://github.com/f7q/learning.git
@f7q
f7q / backuprestore.cmd
Last active October 29, 2020 22:51
Postgresで全テーブルの件数を表示する
set BACKUPDAY=20180211
set DB_NAME=testdb
set EXE_PATH=C:\opt\PostgreSQLPortable_9.6.1\App\PgSQL\bin
set BACKUP_FILE_PATH=C:\opt
set LOG_NAME=%BACKUP_FILE_PATH%\log\%DB_NAME%_log_%BACKUPDAY%.log
set BACKUP_NAME=%BACKUP_FILE_PATH%\data\%DB_NAME%_db_%BACKUPDAY%.sql
REM ポータブルDBからバックアップ(サーバ起動状態)
echo 開始 %DATE% %TIME% > %LOG_NAME%
@f7q
f7q / ER.puml
Last active August 6, 2017 14:07
PlantUMLトレーニング
@startuml
package "外部データベース" as ext <<Database>> {
entity "顧客マスタ" as customer <<M,AAFFAA)>> {
+ 顧客ID [PK]
--
顧客名
郵便番号
住所
電話番号
@f7q
f7q / memo.md
Last active April 8, 2018 05:20
Utility Tools Note
  • Windows
    • cipher /w:c
    • fsutil file testfile 10485760
    • cmd /c start http://www.yahoo.co.jp
    • reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v TcpTimedWaitDelay /t REG_DWORD /d 60 /f
    • powershell compress-archive %CD%\Test %CD%\Test.zip
    • powershell expand-archive %CD%\Test.zip
    • dir /s /b | findstr /e <ファイル名>
    • dir /s /b *.* | findstr /i /b Nuget
    • certutil -hashfile %CD%\aaa.zip MD5
@f7q
f7q / Dockerfile.ubuntu
Last active August 20, 2017 14:55
Ubuntu版 日本語設定
FROM ubuntu:16.04
# system update 50MB程度
RUN apt-get -y update
# set locale
RUN unlink /etc/localtime
RUN ln -s /usr/share/zoneinfo/Japan /etc/localtime
#RUN apt-get reinstall -y glibc-common