Skip to content

Instantly share code, notes, and snippets.

View kumamotone's full-sized avatar
🐈
hello

kumamotone kumamotone

🐈
hello
View GitHub Profile
@kumamotone
kumamotone / main.dart
Last active March 1, 2024 02:57
showOkAdaptiveDialog
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
void main() async {
print("1");
await registerFcmToken();
print("4");
}
Future<void> registerFcmToken() {
print("2");
return addDevice();
}
@kumamotone
kumamotone / uhoho-i.dart
Created February 16, 2022 16:23
クレしんのホラー回って毎回怖い
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
final helloWorldProvider = StateProvider((ref) => 0);
void main() {
runApp(
// Adding ProviderScope enables Riverpod for the entire project
const ProviderScope(child: MyApp()),
);
@kumamotone
kumamotone / main.go
Last active November 30, 2021 01:22
delete all specified signals of BBCSO
package main
import (
"bufio"
"fmt"
"io/fs"
"os"
"path/filepath"
"regexp"
"strings"
@kumamotone
kumamotone / gist:ee2dc368f5bb1cfe846bd509f0a92689
Created April 12, 2020 15:35
OnlineJudgeHelperで毎回ファイルをダウンロードし直す
diff --git a/onlinejudge.py b/onlinejudge.py
index 16f3f48..80100ae 100644
--- a/onlinejudge.py
+++ b/onlinejudge.py
@@ -149,6 +149,9 @@ class OnlineJudge:
print('CompileError')
exit(-1)
+ for input_file_path in glob.iglob(os.path.join(self.options.testcase_directory, '*.in.txt')):
+ os.remove(input_file_path)
@kumamotone
kumamotone / viewHeight.swift
Created February 6, 2020 10:21
仮想的にUIHostingControllerのなかにぶちこんで高さを取得する
let canvas = swiftuiView
let hosting = UIHostingController(rootView: canvas)
hosting.view.frame = window.frame
window.addSubview(hosting.view)
window.makeKeyAndVisible()
hosting.view // これが UIView
import SwiftUI
struct GameSettings {
var isHard: Bool = false
}
struct NextView: View {
@Binding var settings: GameSettings
var body: some View {
@kumamotone
kumamotone / movtogif.sh
Created August 12, 2019 11:37
Making GIF Animation by ffmpeg
osascript -e 'display notification "start" with title "GIF Encode"'
/usr/local/bin/ffmpeg -i "${@}" -filter_complex "[0:v] fps=8,scale=600:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" "${@}".gif
osascript -e 'display notification "Gif encode end"'
import Foundation
import Combine
struct MyPublisher: Publisher {
typealias Output = Int
typealias Failure = Error
func receive<S>(subscriber: S) where S : Subscriber,
Failure == S.Failure,
Output == S.Input {