Skip to content

Instantly share code, notes, and snippets.

Ikiru Yoshizaki guitarrapc

Block or report user

Report or block guitarrapc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View azure-pipelines.yml
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'windows-2019'
View azure-pipelines.yml
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'windows-2019'
@guitarrapc
guitarrapc / Set-PSReadlineComamndHistoryView.ps1
Last active Jun 1, 2019
Show Command histroy on Windows 10's Windows PowerShell via PSReadline
View Set-PSReadlineComamndHistoryView.ps1
Set-PSReadlineKeyHandler -Key F7 -BriefDescription "History" -LongDescription "Show command history" -ScriptBlock {
$pattern = $null
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref] $pattern, [ref] $null)
if ( $pattern ) {
$pattern = [Regex]::Escape($pattern)
}
$history = [System.Collections.ArrayList] @(
$last = ""
$lines = ""
foreach ( $line in [System.IO.File]::ReadLines((Get-PSReadlineOption).HistorySavePath) ) {
@guitarrapc
guitarrapc / fail.cmd
Created May 16, 2019
cmd FINDSTR can act as RegularExpression
View fail.cmd
echo hogemoge-dev | FINDSTR /R ".*staging\>" > NUL
IF %errorlevel% EQU 0 (
echo success staging
) ELSE (
echo fail staging
)
@guitarrapc
guitarrapc / DrawTextToPng.cs
Created May 15, 2019
Draw text to png file generated by SkiaSharp. https://github.com/mono/SkiaSharp
View DrawTextToPng.cs
void Main()
{
DrawTextToPng("Hogemoge-fugaf@-!!!$&'&piyo_-=hiogfew", 10);
}
public void DrawTextToPng(string text, int xPadding = 0)
{
// draw some text
var paint = new SKPaint
{
@guitarrapc
guitarrapc / config
Created May 10, 2019
.ssh config for fowarding
View config
# proxy
Host your-domain-*
ProxyCommand ssh -W %h:%p host.name.is.here
# foward and connect
Host your-bastion-domain-*
User your_user_name
ProxyCommand ssh -W %h:%p foward-domain-name.io
IdentityFile ~/.ssh/id_rsa
ForwardAgent yes
View UAC_RunAsSelfFunction.ps1
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
$me = $MyInvocation.MyCommand
$myDefinition = (Get-Command $me).Definition
$myfunction = "function $me { $myDefinition }"
$cd = (Get-Location).Path
$commands = "Set-Location $cd; $myfunction; Write-Host 'Running $me'; $me; Pause"
$bytes = [System.Text.Encoding]::Unicode.GetBytes($commands)
$encode = [Convert]::ToBase64String($bytes)
View HomeController.cs
public IActionResult Index()
{
var vm = new IndexViewModel
{
Secret = _config.GetValue<string>("ConnectionStrings:DATABASE"),
};
return View(vm);
}
View Program.cs
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.AddAwsSecrets(null, "ap-northeast-1", "PROFILE_NAME")
.UseStartup<Startup>();
View Program.cs
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.AddAwsSecrets("ap-northeast-1")
.UseStartup<Startup>();
You can’t perform that action at this time.