Skip to content

Instantly share code, notes, and snippets.

@Hiroki-Kawakami
Hiroki-Kawakami / AppDelegate.swift
Created Feb 10, 2021
SwiftUI Change Status Bar Color with Custom Hosting Controller
View AppDelegate.swift
//
// AppDelegate.swift
// StatusBarTest
//
// Created by hiroki on 2021/02/11.
//
import UIKit
import SwiftUI
@Hiroki-Kawakami
Hiroki-Kawakami / ContentView.swift
Last active Feb 10, 2021
SwiftUI Change Status Bar Color with UIWindow
View ContentView.swift
//
// ContentView.swift
// StatusBarTest
//
// Created by hiroki on 2021/02/11.
//
import SwiftUI
struct ContentView: View {
@Hiroki-Kawakami
Hiroki-Kawakami / wishlist-total.txt
Last active Feb 10, 2021
Amazon欲しいものリスト合計額を計算するブックマークレット。PC・スマホ両対応(2021年1月時点)
View wishlist-total.txt
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 Nov 22, 2020
Benchmark numpy with matrix multiplication
View numpy_benchmark.py
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 Aug 10, 2020
投稿に画像を扱うカスタムフィールドを追加するサンプルプラグイン
View imagefield.0.md
View mydns_register.py
#!/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"
View OrderedDictionary.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 Jan 24, 2020
ANYCUBIC MEGA-S Marlin 設定ファイル
View setup.gcode
M502
M500
M92 E384
M203 E30
M204 R1500.00
M500