Skip to content

Instantly share code, notes, and snippets.

View uebayasi's full-sized avatar

Masao Uebayashi uebayasi

  • Tombi Inc.
  • Yokohama, Kanagawa, Japan
View GitHub Profile
@uebayasi
uebayasi / googleapis.ts
Created April 24, 2026 12:09
Using Google Script REST API (script_v1) from within GAS
import { script_v1 } from 'googleapis'
import { request } from './request'
#
# - You might want to call Script REST API from within GAS
# - googleapis node client does not work on GAS
# - You still want to re-use type definitions
#
# If you need more entries, check
@uebayasi
uebayasi / gen-appsscript-ts.sh
Created April 24, 2026 11:54
TypeScript type definition of Google Apps Script "appsscript.json" (using pnpm + quicktype)
#!/bin/sh
#
# You might want to handle "appsscript.json" in TypeScript (e.g. generating it)
#
#quicktype=quicktype
quicktype="pnpm dlx quicktype"
curl -L -o appsscript.schema.json http://json.schemastore.org/appsscript
@uebayasi
uebayasi / rslib-gas.ts
Last active April 24, 2026 11:45
Building Google App Script (GAS) with rslib
import { LibConfig, RslibConfig } from '@rslib/core'
// how to use this in rslib.config.ts:
// - `import { gasLib } from './rslib-gas.ts'
// - add a `lib` entry like: `lib: [gasLib('doPut')]`
// - put appsscript.json under public/; it's copied to dist/ as is
//
// how it works:
// - build & bundle .ts into dist/Code.js
// - export global names via `global`; see the first/last lines in Code.js
@uebayasi
uebayasi / rslib.config.ts
Created April 24, 2026 11:39
Building GAS script with rslib
import { LibConfig, defineConfig } from '@rslib/core'
export default defineConfig({
lib: [gasLib(['doGet'])],
source: {
entry: {
index: './src/index.ts',
},
},
output: {
@uebayasi
uebayasi / rmd2pdf.sh
Last active May 3, 2019 13:18
rmd2pdf - Convert RMD to PDF reproducibly
#!/bin/sh
#
# rmd2pdf.sh - Convert RMD to PDF reproducibly
#
# Requirements: lualatex (TeXlive)
#
set -e
rmd=$1
  • Apps Scriptプロジェクトのデプロイ手続きを、非対話的に行えない   - "Publish > Deploy as API executable..."に相当する処理  - REST APIとしてcreate deployが提供されており、呼び出しも成功するが、authorizationができない   - claspも同様  - 一度authorizeされたデプロイを再デプロイすることは、非対話的に行える    - clasp redeployに相当
  • Apps ScriptプロジェクトのCloud Platformへの切り替え手続きを、非対話的に行えない
  • Deployment ManagerでApp Engineのアプリを扱えない
  • そもそもApp EngineはCloud Platformのプロジェクトと1:1なので、それがDeployment Managerとしてどう見えるのかが不明
  • Clone Inkscape Git repo
  • Install brew
    • Update to the latest
  • Build Inkscape following the Wiki except:
    • Install into $HOME/.local instead of ../inst
  • If build fails, install the missing thing by brew install something
    • Repeat until build finishes
  • Fix shared-mime-info
    • mkdir -p /usr/local/share/mime/packages
  • cp /usr/local/Cellar/shared-mime-info/1.8_1/share/shared-mime-info/packages/freedesktop.org.xml /usr/local/share/mime/packages
@uebayasi
uebayasi / openwrt-x86_64-nfs-root.md
Last active September 29, 2020 03:46
Mount root as NFS on OpenWrt x86_64

Summary

  • Not much info available but surely possible
  • Basically same as normal Linux NFS root
  • Except kernel configuration adjustment might be tricky

Environment

  • Target: OpenWrt 15.x on KVM
  • Host Ubuntu 16.04
@uebayasi
uebayasi / openwrt-x86_64-kvm.md
Last active September 6, 2016 09:26
Running OpenWrt (x86_64) on KVM

Basics

  • Ubuntu 16.04
  • Ethernet -> e1000
    • make kernel_menuconfig
    • Intel Pro 1000 (CONFIG_E1000=y)
@uebayasi
uebayasi / ubuntu-pxe-nfsroot.md
Last active September 7, 2016 10:37
Ubuntu PXE + NFS root

Summary

  • Not difficult but documentation inaccurate

Overview

  • Build PXE + NFS root environment for development
    • KVM
    • Serial console
  • Basically [1] but tweaks needed