This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript -l JavaScript | |
ObjC.import("stdlib"); | |
ObjC.import("AppKit"); | |
ObjC.import("PDFKit"); | |
ObjC.import("Vision"); | |
const scriptName = $.NSProcessInfo.processInfo.arguments.objectAtIndex(3).lastPathComponent.js; | |
console.error = (obj) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final class UIImageWriteToSavedPhotosAlbumCompletion: NSObject { | |
var continuation: CheckedContinuation<Void, any Error>? | |
@objc func image(_ image: UIImage, didFinishSavingWithError error: Error?, contextInfo: UnsafeRawPointer) { | |
if let error { | |
continuation?.resume(throwing: error) | |
} else { | |
continuation?.resume() | |
} | |
continuation = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const id = "kiriban-fuminige-kinshi"; | |
const conversions = [ | |
{ unit: "K", rate: 1000 }, | |
{ unit: "M", rate: 1000000 }, | |
{ unit: "B", rate: 1000000000 }, | |
{ unit: "万", rate: 10000 }, | |
]; | |
function run(target) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
ws = new WebSocket("wss://streaming.qiitadon.com:4000/api/v1/streaming/?stream=public:local"); | |
ws.addEventListener("message", (ev) => { | |
const { event, payload } = JSON.parse(ev.data); | |
if (event === "update") { | |
const status = JSON.parse(payload); | |
speechSynthesis.cancel(); | |
speechSynthesis.speak(new SpeechSynthesisUtterance(status.account.display_name || status.account.username)); | |
speechSynthesis.speak(new SpeechSynthesisUtterance(status.content.replace(/<\/?[^>]+(>|$)/g, ""))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install the following packages: | |
// - @eslint/eslintrc | |
// - @typescript-eslint/eslint-plugin | |
// - eslint-config-prettier | |
import { FlatCompat } from "@eslint/eslintrc"; | |
import prettierConfig from "eslint-config-prettier"; | |
const compat = new FlatCompat(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "hello_world" | |
version = "0.1.0" | |
authors = [] | |
[lib] | |
name = "hello_world" | |
path = "./lib.rs" | |
crate-type = ["cdylib"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ws = new WebSocket("wss://streaming.qiitadon.com:4000/api/v1/streaming/?stream=public:local"); | |
ws.addEventListener("message", (ev) => { | |
const { event, payload } = JSON.parse(ev.data); | |
if (event == "update") { | |
const status = JSON.parse(payload); | |
chrome.notifications.create(status.id, { | |
type: "basic", | |
iconUrl: status.account.avatar || status.account.avatar_static || "icon.png", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:deps | |
{ai.djl/api {:mvn/version "0.4.1"} | |
ai.djl.mxnet/mxnet-model-zoo {:mvn/version "0.4.1"} | |
ai.djl.mxnet/mxnet-native-auto {:mvn/version "1.6.0"} | |
org.apache.logging.log4j/log4j-slf4j-impl {:mvn/version "2.13.0"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id=root /> | |
<script type="module"> | |
import Vue from 'https://dev.jspm.io/vue@2.6.10' | |
new Vue({ | |
el: '#root', | |
render: (h) => h('h1', null, 'hello'), | |
}) | |
</script> |
NewerOlder