Skip to content

Instantly share code, notes, and snippets.

View theangkko's full-sized avatar
😸

theangkko theangkko

😸
View GitHub Profile
@theangkko
theangkko / chrome-devtools.md
Created February 15, 2024 23:04 — forked from vbsessa/chrome-devtools.md
How to customize Chrome devtools fonts
  1. Enable #enable-devtools-experiments flag in chrome://flags section.

  2. Open Chorme Devtools and check Settings > Experiments > Allow custom UI themes.

  3. Create the following four files in a dedicated folder.

    3.1. devtools.html

    <html>
    <head></head>
    <body><script src="devtools.js"></script></body>
@theangkko
theangkko / .gitignore
Created February 3, 2024 08:43
gitignore
CoolProp/
buildcoolprop/**
!buildcoolprop/coolprop*.*
buildcoolpropcs/**
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
@theangkko
theangkko / gh-pages-deploy.md
Created January 18, 2024 20:59 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@theangkko
theangkko / excel_const_enum.py
Last active December 21, 2023 23:29
excel const ENUM list
# ------------------------------------------------------------------
# Excelの定数を設定
# ------------------------------------------------------------------
# https://excel-ubara.com/EXCEL/EXCEL905.html
# https://docs.microsoft.com/en-us/office/vba/api/excel(enumerations)
# https://docs.microsoft.com/ja-jp/office/vba/api/excel(enumerations)
# ------------------------------------------------------------------
# Excelの定数を取得する方法もあるようです。
# https://wacky.hatenadiary.com/entry/20091011/1255240572
# https://endjin.com/blog/2023/03/how-to-setup-python-pyenv-poetry-on-windows
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string] $PythonVersion
)
$ErrorActionPreference = "Stop"
@theangkko
theangkko / openpyxl-sort-function.py
Last active November 24, 2023 09:55
openpyxl sort function _stackoverflow
# https://stackoverflow.com/questions/44767554/sorting-with-openpyxl
def sheet_sort_rows(ws, row_start, row_end=0, cols=None, sorter=None, reverse=False):
""" Sorts given rows of the sheet
row_start First row to be sorted
row_end Last row to be sorted (default last row)
cols Columns to be considered in sort
sorter Function that accepts a tuple of values and
returns a sortable key
@theangkko
theangkko / Install-ChocoWinget.ps1
Last active November 29, 2023 21:22
window-Sandbox-setup-files
Set-ExecutionPolicy Bypass ` -Scope Process ` -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install git -y
# choco install googlechrome vscode -y
$progressPreference = 'silentlyContinue'
Write-Information "Downloading WinGet and its dependencies..."
Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
Function Check-RunAsAdministrator()
{
#Get current user context
$CurrentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
#Check user is running the script is member of Administrator Group
if($CurrentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator))
{
Write-host "Script is running with Administrator privileges!"
}
@theangkko
theangkko / Dockerfile
Created September 25, 2023 23:14 — forked from soof-golan/Dockerfile
Python + Poetry + Docker Example
FROM python:3.10 as python-base
# https://python-poetry.org/docs#ci-recommendations
ENV POETRY_VERSION=1.2.0
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
# Tell Poetry where to place its cache and virtual environment
ENV POETRY_CACHE_DIR=/opt/.cache
@theangkko
theangkko / tgCF.EXCEL.yaml
Created July 12, 2023 04:38
OfficeJS-excel custom function by theangkko
name: tgCF
description: |-
OfficeJS-excel custom function
by theangkko
host: EXCEL
api_set: {}
script:
content: >
// $("#run").click(() => tryCatch(run)); // async function run() { //
await Excel.run(async (context) => { // const sheet =