Skip to content

Instantly share code, notes, and snippets.

@lyo
lyo / append.js
Last active August 5, 2025 16:00
X archiveのログ検索にて、投稿日リンクをクリックするとその日postしたのに絞るやつ
/*
* This script is provided for personal use only and must be used in compliance with X's Terms of Service
* (https://x.com/en/tos) and Developer Agreement (https://developer.x.com/en/developer-terms).
* Do not share, publish, or use X archive data for commercial purposes.
*/
(function() {
// タイム日付のリンクを押したときだけ処理する
document.addEventListener("click", function(e) {
const target = e.target.closest("a.Tweet-timestamp");
if (target) {
@lyo
lyo / favon_ldr.user.js
Created February 17, 2021 15:58 — forked from shokai/favon_ldr.user.js
Fav on LDR
// ==UserScript==
// @name Favon LDR
// @namespace http://hoge.sub.jp/blog/
// @description add to twitter's favorites on LDR
// @include http://reader.livedoor.com/reader/*
// @include http://fastladder.com/reader/*
// @resource star http://assets0.twitter.com/images/icon_star_full.gif
// @version 0.0.3
// ==/UserScript==
--- reblogcommand_rev11618.user.js Sun May 18 13:57:18 2008
+++ reblogcommand_add_privatemode.user.js Sun May 18 15:37:53 2008
@@ -1,8 +1,9 @@
// ==UserScript==
-// @name ReblogCommand
-// @namespace http://white.s151.xrea.com/
-// @include http://*
-// @include https://*
+// @name ReblogCommand_add_privatemode
+// @namespace http://white.s151.xrea.com/ -> pathch(http://hoge.sub.jp/blog/archives/2008/05/privatereblogre.html)
#include <stdio.h>
int add(a,b)
int a, b;
{
return a+b;
}
int main(void){
printf("%d \n", add(1,5));
@lyo
lyo / 20_Tumblr.js.patch
Created January 31, 2021 06:52
privateReblog
--- 20_Tumblr.js.old Sun Apr 13 07:06:00 2008
+++ 20_Tumblr.js Tue Apr 15 19:51:52 2008
@@ -180,6 +180,47 @@
});
},
+ //testing
+ privateReblog : function(url){
+ return maybeDeferred(Tumblr.getReblogToken(url) || doXHR(url).addCallback(function(res){
+ return Tumblr.getReblogToken(res.responseText.match('iframe src="(.*?)"')[1]);
@lyo
lyo / browser.mine.xul.patch
Created January 31, 2021 06:51
privareReblog
--- browser.zeromemory.xul Tue Apr 15 22:11:34 2008
+++ browser.mine.xul Mon Apr 14 22:38:52 2008
@@ -40,7 +40,7 @@
GM_Tombloo.Tombloo.Service = update({}, env.Tombloo.Service,
'check share posters extracters'.split(' '));
GM_Tombloo.Tumblr = update({}, env.Tumblr,
- 'post remove getInfo read reblog openTab getLoggedInUser getReblogToken TUMBLR_URL'.split(' '));
+ 'post remove getInfo read reblog privateReblog openTab getLoggedInUser getReblogToken TUMBLR_URL'.split(' '));
GM_Tombloo.FFFFOUND = update({}, env.FFFFOUND,
'post remove iLoveThis'.split(' '));
--- reblogcommand.user.js Tue Apr 15 22:00:15 2008
+++ reblogcommand_with_privatemode_vt.user.js Tue Apr 15 22:07:14 2008
@@ -1,7 +1,8 @@
// ==UserScript==
-// @name ReblogCommand
+// @name ReblogCommand_with_privatemode_vt
// @namespace http://white.s151.xrea.com/
-// @include *
+// @include http://reader.livedoor.com/reader/*
+// @include http://fastladder.com/reader/*
@lyo
lyo / LinkedHashMapTest.java
Last active August 3, 2025 14:00
java sample code
package test;
import java.util.LinkedHashMap;
import java.util.Map;
public class LinkedHashMapTest extends LinkedHashMap {
private static final long serialVersionUID = 8641341953159332320L;
private static final int MAX_ENTRIES = 3;//貯め込められるのは3まで。
--- reblogcommand.user.js Wed Apr 2 23:57:29 2008
+++ reblogcommand_with_privatemode.user.js Thu Apr 3 00:11:48 2008
@@ -1,7 +1,8 @@
// ==UserScript==
-// @name ReblogCommand
+// @name ReblogCommand_with_privatemode
// @namespace http://white.s151.xrea.com/
-// @include *
+// @include http://reader.livedoor.com/reader/*
+// @include http://fastladder.com/reader/*
@lyo
lyo / letter_frequency.py
Created November 15, 2020 06:33
アルファベット出現頻度確認
import collections, sys
from string import ascii_lowercase
def filecharcount(openfile):
return sorted(collections.Counter(char for line in
openfile for char in line.lower() ).items())
f = open(sys.argv[1])
for letter, repetitions in filecharcount(f):
print(letter, repetitions)