Skip to content

Instantly share code, notes, and snippets.

View sssho's full-sized avatar

sssho

  • Tokyo, Japan
View GitHub Profile
@sssho
sssho / sample.yaml
Last active September 23, 2025 11:57
cloud-init sample
#cloud-config
locale: ja_JP.UTF-8
timezone: Asia/Tokyo
users:
- name: sssho
groups: users,sudo,cdrom,adm,dip,plugdev
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: true
write_files:
@sssho
sssho / sample.vb
Last active June 21, 2024 22:47
vba sample
Option Explicit
Sub test()
Debug.Print "--- start"
' tableTest
' insertTest
findTest
Debug.Print "--- end"
End Sub
@sssho
sssho / past.dax
Last active April 9, 2023 14:27
duration major
@duration =
VAR Duration = SUM('table'[duration])
VAR Hours = INT(Duration * 24)
VAR Minutes = INT(MOD(Duration * 24 * 60, 60))
VAR Seconds = INT(MOD(Duration * 24 * 60 * 60, 60))
RETURN
FORMAT(Hours,"00") & "h" & FORMAT(Minutes,"00") & "m" & FORMAT(Seconds,"00") & "s"
@sssho
sssho / pyproject.toml
Last active December 11, 2022 13:32
pyproject.toml
[tool.isort]
profile = "black"
[tool.mypy]
namespace_packages = false
ignore_missing_imports = true
check_untyped_defs = true
[tool.pylint."messages control"]
max-line-length = 88
@sssho
sssho / python.json
Created November 27, 2022 13:31
vscode snippets
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@sssho
sssho / data.yaml
Last active September 25, 2022 01:44
load yaml in bash script
- class: first
users:
- name: hoge
type: one
value: 1
- name: fuga
type: two
value: 2
- class: second
users:
@sssho
sssho / refresh_excel.py
Last active February 20, 2023 21:49
refresh excel
import win32com.client
def main(excel_path: str):
x = win32com.client.Dispatch("Excel.Application")
wb = x.Workbooks.Open(excel_path)
wb.refreshall()
wb.Save()
wb.Close(SaveChanges=True)
@sssho
sssho / lnk.go
Created August 22, 2022 14:06
read lnk
// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-shllink/4d25bbad-09b7-4322-8c0a-521d268481bb
package main
import (
"bufio"
"bytes"
"encoding/binary"
"fmt"
"io"
@sssho
sssho / vscode_key.json
Created August 21, 2022 08:54
vscode keyboard shortcut setting
// Place your key bindings in this file to override the defaults
[
// Disable default settings
{
"key": "ctrl+p",
"command": "-workbench.action.quickOpenNavigateNextInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
{
"key": "ctrl+n",
@sssho
sssho / focus_selected_excel.py
Created August 7, 2022 07:01
Select opened excel by peco, then focus it
"""
Select opened excel workbook and foucs it
Requirment:
peco.exe in your PATH
"""
import sys
import subprocess
import shutil