Skip to content

Instantly share code, notes, and snippets.

@Hiroki-Kawakami
Hiroki-Kawakami / AppDelegate.swift
Created February 10, 2021 19:22
SwiftUI Change Status Bar Color with Custom Hosting Controller
//
// AppDelegate.swift
// StatusBarTest
//
// Created by hiroki on 2021/02/11.
//
import UIKit
import SwiftUI
@Hiroki-Kawakami
Hiroki-Kawakami / ContentView.swift
Last active May 7, 2024 18:38
SwiftUI Change Status Bar Color with UIWindow
//
// ContentView.swift
// StatusBarTest
//
// Created by hiroki on 2021/02/11.
//
import SwiftUI
struct ContentView: View {
@Hiroki-Kawakami
Hiroki-Kawakami / wishlist-total.txt
Last active February 10, 2021 18:12
Amazon欲しいものリスト合計額を計算するブックマークレット。PC・スマホ両対応(2021年1月時点)
javascript:(function(){alert('¥'+Array.from(document.querySelectorAll('.a-offscreen')).reduce((a,c)=>a+Number(c.innerText.replace(/[^0-9]/g,'')),0))})();
@Hiroki-Kawakami
Hiroki-Kawakami / numpy_benchmark.py
Created November 22, 2020 09:43
Benchmark numpy with matrix multiplication
import numpy as np
from time import time
np.__config__.show()
np.random.seed(0)
size = 4096
A, B = np.random.rand(size, size), np.random.rand(size, size)
N = 20
@Hiroki-Kawakami
Hiroki-Kawakami / imagefield.0.md
Last active January 4, 2024 11:03
投稿に画像を扱うカスタムフィールドを追加するサンプルプラグイン
#!/usr/bin/python
import urllib.parse
import urllib.request
import base64
import sys
import os
def mydns_register_validation(master_id, password, domain, validation, cmd = "REGIST"):
url = "https://www.mydns.jp/directedit.html"
@Hiroki-Kawakami
Hiroki-Kawakami / OrderedDictionary.swift
Created May 3, 2020 12:07
Ordered Dictionary in Swift
import Foundation
struct OrderedDictionary<Key: Hashable, Value>: Sequence, IteratorProtocol, CustomStringConvertible {
private(set) var keys = [Key]()
private var dictionary = [Key: Value]()
init() {}
init(dictionary: [Key: Value], order: [Key]) {
@Hiroki-Kawakami
Hiroki-Kawakami / setup.gcode
Created January 24, 2020 12:22
ANYCUBIC MEGA-S Marlin 設定ファイル
M502
M500
M92 E384
M203 E30
M204 R1500.00
M500