Skip to content

Instantly share code, notes, and snippets.

@swfz
swfz / hightlight.js
Last active April 6, 2024 19:31
GoogleSlideで画像などに強調したい部分以外に半透明の図形を被せるアドオン
function onInstall(e) {
onOpen();
}
function onOpen(e) {
SlidesApp.getUi().createAddonMenu()
.addItem('Hightlight(Black)', 'highlightBlack')
.addItem('Hightlight(White)', 'highlightWhite')
.addToUi();
}
@swfz
swfz / updateTocLinkPageNumber.js
Created January 27, 2024 16:08
GoogleSlideでスライド内リンクの末尾にページ数を付与する(更新の場合は最新情報にする)
function onInstall(e) {
onOpen();
}
function onOpen(e) {
SlidesApp.getUi().createAddonMenu()
.addItem('Update TOC Link Page Number', 'updateTocLinkPageNumber')
.addToUi();
}
@swfz
swfz / cartoonishEmphasis.js
Last active January 27, 2024 15:48
GoogleSlideで漫画風強調表示をサクッと作るためのGASコード
function onInstall(e) {
onOpen();
}
function onOpen(e) {
SlidesApp.getUi().createAddonMenu()
.addItem('Cartoonish Emphasis', 'createCircularLayout')
.addToUi();
}
@swfz
swfz / create_view.sql
Last active May 24, 2022 18:28
rake routes to bigquery path hierarchy
CREATE OR REPLACE MATERIALIZED VIEW
`project.dataset.viwe_table` AS
WITH
with_path AS (
SELECT
*,
REGEXP_REPLACE(request_url, r"https?://.*?/", "/") AS path
FROM
`project.dataset.table` )
SELECT
@swfz
swfz / notion-sample.js
Created January 17, 2022 16:26
rollup column sample
const { Client, LogLevel } = require("@notionhq/client")
const notion = new Client({
logLevel: LogLevel.DEBUG,
auth: process.env.NOTION_TOKEN
});
(async() => {
const pageId = process.env.NOTION_PAGE_ID;
const checks = await notion.databases.create({
@swfz
swfz / Error: Provider produced inconsistent final plan
Created April 3, 2021 01:35
Error: Provider produced inconsistent final plan
2021/04/03 10:28:28 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2021/04/03 10:28:28 [INFO] Terraform version: 0.14.6
2021/04/03 10:28:28 [INFO] Go runtime version: go1.15.6
2021/04/03 10:28:28 [INFO] CLI args: []string{"/home/sawafuji/.tfenv/versions/0.14.6/terraform", "apply", "-var-file=default.tfvars"}
2021/04/03 10:28:28 [DEBUG] Attempting to open CLI config file: /home/sawafuji/.terraformrc
2021/04/03 10:28:28 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/04/03 10:28:28 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
@swfz
swfz / display-data-source-icon.patch
Created September 2, 2019 09:37
[Redash] v8 クエリエディタでデータソースのアイコンを表示するパッチ
diff --git client/app/pages/queries/query.html client/app/pages/queries/query.html
index 7837571f..14fa8fe3 100644
--- client/app/pages/queries/query.html
+++ client/app/pages/queries/query.html
@@ -85,9 +85,12 @@
<div class="editor__left__data-source">
<ui-select ng-model="query.data_source_id" remove-selected="false" ng-disabled="!isQueryOwner || !sourceMode"
on-select="updateDataSource()" data-test="SelectDataSource">
- <ui-select-match placeholder="Select Data Source...">{{$select.selected.name}}</ui-select-match>
+ <ui-select-match placeholder="Select Data Source..." class="align-items-center">
@swfz
swfz / multifilter-default-all-value.patch
Last active September 2, 2019 09:35
[Redash] v8 `multi-filter`でデフォルトのフィルタ件数を全件にするパッチ
diff --git client/app/services/query-result.js client/app/services/query-result.js
index a267cee0..a0ae32a4 100644
--- client/app/services/query-result.js
+++ client/app/services/query-result.js
@@ -265,6 +265,10 @@ function QueryResultService($resource, $timeout, $q, QueryResultError, Auth) {
}
return v;
});
+
+ if (filter.multiple) {
@swfz
swfz / 0_hatenablog_with_photolife.rb
Last active August 30, 2020 22:41
はてなブログのAPIを使って画像も一緒にポストするサンプル
#!/usr/bin/env ruby
# hatenablog.rb
# 別途下記環境変数が必要
# HATENABLOG_CONSUMER_KEY
# HATENABLOG_CONSUMER_SECRET
# HATENABLOG_ACCESS_TOKEN
# HATENABLOG_ACCESS_TOKEN_SECRET
# 例
# ruby hatenablog.rb --filename docs/hoge/fuga.md --draft --user hoge --site hoge-fuga.hatenablog.com