Skip to content

Instantly share code, notes, and snippets.

View kissge's full-sized avatar
😮‍💨
優秀エンジニア手伝ってくれたのむ

Yusuke Kido kissge

😮‍💨
優秀エンジニア手伝ってくれたのむ
View GitHub Profile
Function Analysis() {
echo "Analysis ver. 1"
date
Get-ComputerInfo | Out-String
echo "=========="
echo "the contents of hosts file:"
cat C:\Windows\system32\drivers\etc\hosts
echo "=========="
@kissge
kissge / darkmode-when-connected-to-VPN.sh
Created February 4, 2021 12:12
macOS: VPNに接続中だけ自動的にダークモードにする
while :; do
if ifconfig | grep -q ipsec0; then
osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to true'
else
osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to false'
fi
sleep 5
done
curl -sSO https://dl.google.com/cloudagents/add-monitoring-agent-repo.sh
sudo bash add-monitoring-agent-repo.sh
sudo apt-get update
sudo apt-cache madison stackdriver-agent
sudo apt-get install -y 'stackdriver-agent=6.*'
sudo service stackdriver-agent start
sudo systemctl enable stackdriver-agent
import json
import os
import re
import sys
with open(sys.argv[1]) as fp:
obj = json.load(fp)
dir = f'{obj["name"]}'
os.makedirs(dir, exist_ok=True)
@kissge
kissge / saveSheetsAsCSV.vba
Last active May 3, 2020 14:33
Excelの全シートをそれぞれCSVエクスポートする
Sub saveSheetsAsCSV()
Dim i As Integer
Dim fName As String
Application.DisplayAlerts = False
For i = 1 To Worksheets.Count
fName = "C:\Users\yk\Downloads\sheet-" & i & ".csv"
ActiveWorkbook.Worksheets(i).SaveAs Filename:=fName, FileFormat:=xlCSVUTF8
Next i
End Sub
import admin from 'firebase-admin';
admin.initializeApp();
function listAllUsers(nextPageToken?: any) {
// List batch of users, 1000 at a time.
admin
.auth()
.listUsers(10, nextPageToken)
.then(function(listUsersResult) {
@kissge
kissge / docker.sh
Created April 25, 2020 13:33
Dockerとdocker-composeをDebianにインストールする
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
@kissge
kissge / app.html
Created March 10, 2020 13:24
Vue (Nuxt) でテンプレートもHTMLファイルに独立させたい! の試行(問題点:HMRできなくなる)
<template>
<div>
{{ x }}
</div>
</template>
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,59,00,70,00,\
00,00,00,00
<!doctype html>
<html>
<head>
<style>
* {
box-sizing: border-box;
}