This file contains hidden or 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
package main | |
import ( | |
"context" | |
"encoding/json" | |
"flag" | |
"log" | |
"net" | |
"net/http" | |
"os" |
This file contains hidden or 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 pwsh | |
# I always put a file named "backend.tf" in the root modules. | |
# Also, I don't create the name "backend.tf" in the non-root module directory. | |
# It seems to be my own rule, but most other people seem to do the same. | |
Get-ChildItem 'backend.tf' -Recurse | ` | |
Select-Object -ExpandProperty FullName | ` | |
ForEach-Object { ` | |
Write-Output $_; ` | |
terraform "-chdir=$(Split-Path $_)" init -upgrade; ` |
This file contains hidden or 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 pwsh | |
git branch --format "%(if:equals=*)%(HEAD)%(then)%(refname:short)`t%(upstream:short)%(end)" | ` | |
Where-Object { $_.Length -ne 0 } | ` | |
ForEach-Object { $s = $_.Split("`t"); @{'branch'=$s[0]; 'upstream'=$s[1] } } | ` | |
ConvertTo-Json |
This file contains hidden or 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
{ | |
"DockerId": "ea7886f0fd4707b60efc507efeeaa6289b03cffe68d08bb99e04e6dc49f9d325", | |
"Name": "hello-ecs", | |
"DockerName": "ecs-task-definition-name-1-hello-ecs-bc9c99e3ea95ea981500", | |
"Image": "947146334561.dkr.ecr.ap-northeast-2.amazonaws.com/ecs-repository-name:hello_ecs", | |
"ImageID": "sha256:5373156d1db82d2920edd8790c8c6bd1a0421456c3df2e5625c12e0de24ca3a7", | |
"Labels": { | |
"com.amazonaws.ecs.cluster": "arn:aws:ecs:ap-northeast-2:947146334561:cluster/cluster-name", | |
"com.amazonaws.ecs.container-name": "hello-ecs", | |
"com.amazonaws.ecs.task-arn": "arn:aws:ecs:ap-northeast-2:947146334561:task/cluster-name/228148e27bd34dbaae2409dedabcee76", |
This file contains hidden or 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
function Get-RegistryValue | |
{ | |
param | |
( | |
[parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Path, | |
[parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Value | |
) | |
if (Test-Path $Path) | |
{ |
This file contains hidden or 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
$invocation = (Get-Variable MyInvocation).Value | |
$invocationDir = Split-Path $invocation.MyCommand.Path | |
Get-ChildItem $invocationDir | ForEach-Object { | |
$p = (Join-Path -Path $_.FullName -ChildPath '.git') | |
if (Test-Path -Path $p) { | |
Write-Host "git --git-dir="${p}" fetch --prune --all" | |
git --git-dir="${p}" fetch --prune --all | |
} | |
} |
This file contains hidden or 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
#ifndef LITERALSTRINGVIEW__H__ | |
#define LITERALSTRINGVIEW__H__ | |
#include <cassert> | |
#include <string_view> | |
class LiteralStringViewHolder; |
This file contains hidden or 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
#ifndef SPLITMIX64__H__ | |
#define SPLITMIX64__H__ | |
#include <cstdint> | |
constexpr uint64_t splitmix64_stateless(uint64_t previous_state) noexcept | |
{ | |
uint64_t z = previous_state + 0x9E3779B97F4A7C15ull; | |
z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9ull; | |
z = (z ^ (z >> 27)) * 0x94D049BB133111EBull; |
This file contains hidden or 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
#include "CoarseClock.h" | |
#if defined(_WIN32) || defined(_WIN64) | |
#if defined(_M_IX86) || defined(_M_AMD64) | |
#include <Windows.h> |
This file contains hidden or 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
#include "get_first_mac_address_windows.h" | |
#include <vector> | |
#include <WinSock2.h> | |
#include <ws2ipdef.h> | |
#include <WS2tcpip.h> | |
#include <iphlpapi.h> | |
NewerOlder