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
<!-- Googleアドセンスのinsのdata-ad-statusがunfilledの時はnone --> | |
<style> | |
ins[data-ad-status="unfilled"] { | |
display: none; | |
} | |
</style> | |
<!-- 広告読み込み --> | |
<script> | |
(function(){ |
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
// ==UserScript== | |
// @name Scrapbox to Hatena Blog Post | |
// @namespace http://tampermonkey.net/ | |
// @version 0.4 | |
// @description Scrapboxのページデータを取得してはてなブログに投稿するスクリプト | |
// @author yuki2021 | |
// @match https://scrapbox.io/* | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== |
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
#!/bin/zsh | |
# testのディレクトリにlogger.dartのimport文を挿入するための使い捨てスクリプト | |
# 検索するコメント | |
search_string="// FirebaseSecureStorageをモック化" | |
# 挿入するインポート文 | |
import_statement="import 'package:test_2023/constant/logger.dart';" |
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
javascript:(function() { | |
var urls = [ | |
'https://www.nikkei.com/', | |
'https://www3.nhk.or.jp/news/', | |
'https://ryukyushimpo.jp/', | |
'https://www.asahi.com/', | |
'https://www.sankei.com/', | |
'https://courrier.jp/', | |
'https://www.cnn.co.jp/', | |
'https://www.bbc.com/japanese', |
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
<?php | |
/// 渡されたURLでDBを検索する。見つけたデータを返す | |
public function searchDB($url) { | |
// APCuにキャッシュがあればそれを返す | |
$data = apcu_fetch($url); | |
if ($data === false) { | |
$sql = 'SELECT b.abstract FROM `hatena_blog_data` AS a | |
LEFT JOIN `hatena_content_abstract` AS b | |
ON a.`id` = b.`hatena_blog_id` | |
where b.`abstract` IS NOT NULL AND |
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
import 'dart:async'; | |
void main() async { | |
Completer completer = Completer<String>(); | |
// 非同期処理を開始します(ここでは2秒待つだけ) | |
Future.delayed(Duration(seconds: 2)).then((_) { | |
// 非同期処理が完了したらエラーを投げます | |
completer.completeError(Exception("Something went wrong")); | |
}); |
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
import 'dart:async'; | |
void main() async { | |
Completer completer = Completer<String>(); | |
// 非同期処理を開始します(ここでは2秒待つだけ) | |
Future.delayed(Duration(seconds: 2)).then((_) { | |
// 非同期処理が完了したらCompleterを完成させます | |
completer.complete("Hello, World!"); | |
}); |
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
// その日の日付のページが存在するかどうか | |
Future<bool> pageExists(String title) async { | |
try { | |
// webViewContrllerを取得 | |
final webViewController = ref.watch(webViewControllerProvider); | |
final url = | |
'https://scrapbox.io/api/pages/$_scrapboxProject/${Uri.encodeComponent(title)}'; | |
if (webViewController == null) return false; |
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
// ==UserScript== | |
// @name scrapbox_open_diary | |
// @version 1.0 | |
// @description Scrapboxでその日の日付の日記ページを開く | |
// @author yuki2021 | |
// @match https://scrapbox.io/* | |
// ==/UserScript== | |
var optDown = false; |
NewerOlder