Skip to content

Instantly share code, notes, and snippets.

View ykrods's full-sized avatar

ykrods ykrods

  • Kanagawa, Japan
View GitHub Profile
/**
* prerender (SSG) with svelte
*
* based on: https://github.com/sssx-dev/sssx
*/
import fs from "node:fs/promises";
import { fileURLToPath } from 'node:url'
import { compile } from "svelte/compiler";
import esbuild from "esbuild";
@ykrods
ykrods / skeleton-history-base-router.html
Created April 15, 2024 07:13
historyベースルータの最小実装的なもの
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>history iframe</title>
<script>
let page = window.location.pathname;
function updateContent(path) {
console.log(`history.length: ${window.history.length}`);
/**
* Flutter で PullToRefresh + InfiniteScroll 実装例
*
* # ポイント
* - Mixin で InfinateScroll の実装を分割している
*
* # 課題
* - ListView に対して ScrollController が一つしか指定できないので他にスクロール関連でやりたいことがある場合は
* このままの形では使えない
*/
@ykrods
ykrods / pyodide-memo.js
Last active February 2, 2024 10:16
pyodide メモ
/**
* js -> python でデータを渡す方法
*
* ユーザ入力をそのまま runPython(`${x}`) とかすると危なそうなので、変数として渡したい場合
*
* 参考: https://pyodide.org/en/stable/usage/type-conversions.html#calling-python-objects-from-javascript
*/
const pyodide = await loadPyodide();
pyodide.global.set("x", 1);
/**
* Swift (v4.2.1) Quick Start
*
* see: https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html
*/
// variable
var n = 1
// constant

Keybase proof

I hereby claim:

  • I am ykrods on github.
  • I am ykrods (https://keybase.io/ykrods) on keybase.
  • I have a public key ASBhMWHbx3cR221KXkekFRqPWQUFUM_Bt9mH9YG78Gjk4Ao

To claim this, I am signing this object: