Skip to content

Instantly share code, notes, and snippets.

View ttskch's full-sized avatar

Takashi Kanemoto ttskch

View GitHub Profile
@ttskch
ttskch / .vscode\extensions.jsonc
Last active March 21, 2025 01:17
my vscode(cursor) settings
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"biomejs.biome",
"devsense.composer-php-vscode",
"editorconfig.editorconfig",
"jasonlhy.hungry-delete",
# https://ghostty.org/docs/config/reference
macos-titlebar-proxy-icon = hidden
theme = 0x96f
background-opacity = 0.85
# 補完の文字の色を濃く
palette = 8=#a8a8a6
@ttskch
ttskch / get-devices.sh
Last active December 3, 2024 02:48
SwitchBot API Shell Script Example
#!/bin/sh -eu
token="my-token"
secret="my-secret"
t=$(date +%s000)
nonce=$(uuidgen)
sign=$(/bin/echo -n "$token$t$nonce" | openssl dgst -sha256 -hmac $secret -binary | base64)
curl https://api.switch-bot.com/v1.1/devices \
@ttskch
ttskch / nagoya.md
Created June 19, 2019 02:14
Nagoya.php 初心者向け課題

(A) 開発環境がない人向け

開発環境を作って、PHPで"Hello World"してみよう!

1. XAMPPまたはMAMPをインストール

WindowsやLinuxの人は XAMPP を、Macの人は MAMP をインストールしましょう。

参考

@ttskch
ttskch / amazon-calc.js
Created March 29, 2018 15:40 — forked from koyopro/amazon-calc.js
Amazonで一年間に使った金額と、注文履歴のTSVを出力するブックマークレット【2015年版】
// Amazonの注文履歴をTSV形式で出力するスクリプト
//
// 2015-01-01 時点での DOM 構造に対応, GoogleCrome, Opera でテスト済。
// formatEntry関数を書き換えれば自由な書式で出力できます。
//
// 参考:
// - Amazonの注文履歴をCSV形式にして出力するスクリプト
// https://gist.github.com/arcatdmz/8500521
// - Amazon で使った金額の合計を出す奴 (2014 年バージョン)
// https://gist.github.com/polamjag/866a8af775c44b3c1a6d
@ttskch
ttskch / form.scss
Last active January 26, 2020 01:06
Symfony Form Theme for Bootstrap4
$color-danger: #dc3545;
$color-success: #28a745;
.form-group > label {
&.required {
&:after {
content: " *";
color: $color-danger;
}
}
@ttskch
ttskch / style.scss
Created October 13, 2017 07:04
olを(1)形式にしつつulとolの位置関係を美しく揃えるcss
$list-margin-left: 3rem;
$ol-padding-left: 0.4rem;
ul {
margin-left: $list-margin-left;
padding-left: 0;
}
ol {
counter-reset: ol;
@ttskch
ttskch / itunes.sh
Created February 28, 2017 07:14 — forked from rkumar/itunes.sh
control iTunes from command line
#!/bin/bash
#
####################################
# iTunes Command Line Control v1.0
# written by David Schlosnagle
# created 2001.11.08
# edit 2010.06.01 rahul kumar
####################################
showHelp () {
@ttskch
ttskch / trello2md.js
Created April 28, 2016 06:46
Trelloの"Today"リストにあるカードのタイトルをMarkdownのチェックリスト形式のテキストでプロンプトに表示するブックマークレット
javascript: (function (f) {
var t = document.createElement('script');
t.src = '//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js';
t.onload = function () {
f(jQuery.noConflict(true));
};
document.body.appendChild(t);
})(function ($) {
var md = '';
$('.list-header-name:contains("Today")').parents('.list').children('.list-cards').children('.list-card').each(function () {
@ttskch
ttskch / 01.nagoyaphp11.php
Last active April 16, 2016 06:50
Nagoya.php #11 プログラミング問題回答例
<?php
// 家系図全体の定義.
// 配列の最初の要素は親、それ以降の要素は子を表す.
$tree = [
1 => [null, 2, 3, 4],
2 => [1, 5, 6, 7],
3 => [1, 8, 9, 10],
4 => [1, 11, 12, 13],
5 => [2, 14, 15, 16],
6 => [2, 17, 18, 19],