Skip to content

Instantly share code, notes, and snippets.

View xhiroga's full-sized avatar

Hiroaki Ogasawara xhiroga

View GitHub Profile
@xhiroga
xhiroga / vlc-blulay.yml
Created April 29, 2024 13:54
Enable Blu-lay in VLC (but I couldn't succeed)
## References
# https://vlc-bluray.whoknowsmy.name/
---
- name: Create temporary directory for downloads
ansible.windows.win_tempfile:
state: directory
suffix: downloads
register: temp_dir
@xhiroga
xhiroga / README.md
Last active April 29, 2024 08:42
My Selection Search Options
@xhiroga
xhiroga / README.md
Last active December 11, 2021 10:11
doit - シンプルなdotfilesマネージャー(企画書)

doitはシンプルなdotfilesマネージャーです。
GitHubで一番人気のあるmathiasbynens/dotfilesの形式に対応しています。 実際、doitの名前はそのリポジトリのbootstrap用シェルスクリプトの関数から取られています。

バイナリをインストールしたら、指定したdotfilesリポジトリのファイルを $HOME にコピーすることしかできません。しかも、同名のファイルがある場合は(確認の後)上書きします。 しかし、テンプレートエンジンやパスワードマネージャーとの統合はサポートされています。(chezmoiに影響されています)

できること

  • バイナリインストール
  • リモート・ローカル両方のdotfilesを指定可能
@xhiroga
xhiroga / gist:0e24b0e957afd70fdd59482fa62f0bbc
Created October 26, 2020 02:54
[GAS] protect all sheets
function protectAllSheets() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var shs = ss.getSheets();
var me = Session.getEffectiveUser();
for (var i = 0; i < shs.length; i++){
var sheet = shs[i]
var protection = sheet.protect().setDescription('protect sheet by "function protectAllSheets()"');
protection.addEditor(me);
protection.removeEditors(protection.getEditors());
if (protection.canDomainEdit()) {
### Keybase proof
I hereby claim:
* I am xhiroga on github.
* I am hiroga (https://keybase.io/hiroga) on keybase.
* I have a public key whose fingerprint is 1694 5E22 1B0B AF41 3918 A7F1 BAB0 76B5 3124 D139
To claim this, I am signing this object:
@xhiroga
xhiroga / cheatsheet.py
Created March 16, 2020 22:53
cheatsheets
# Reference
# TBD...
@xhiroga
xhiroga / asdict.py
Created November 20, 2019 00:26
Pythonでdaataclassのうち、値がNoneの項目を除外して辞書化するスニペット
dataclasses.asdict(
obj,
dict_factory=lambda tuples: {tuple[0]: tuple[1] for tuple in tuples if tuple[1] is not None}
)

Keybase proof

I hereby claim:

  • I am hiroga-cc on github.
  • I am hiroga (https://keybase.io/hiroga) on keybase.
  • I have a public key ASBj6eaQbF_bjbHbCWraLgBrwno9_jellWktW-VvXg8V8Ao

To claim this, I am signing this object:

@xhiroga
xhiroga / vpc_template_by_cdk.yaml
Created October 5, 2019 23:09
AWS CDKで構築したVPCのテンプレート
Resources:
CDKTESTHIROGA2CBE18D7:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsHostnames: true
EnableDnsSupport: true
InstanceTenancy: default
Tags:
- Key: Name
@xhiroga
xhiroga / kotlinfest2019.md
Last active January 3, 2020 04:19
Kotlin Fest 2019 登壇資料まとめ