Skip to content

Instantly share code, notes, and snippets.

@nikolat
nikolat / bluesky-sstp-over-http.user.js
Last active February 25, 2024 06:35 — forked from unarist/mastodon-sstp-over-http.user.js
SSTP over HTTP で喋らせるボタンを生やすやつ
// ==UserScript==
// @name Bluesky - SSTP over HTTP で喋らせるボタンを生やすやつ
// @namespace https://github.com/nikolat/
// @version 0.1
// @contributor unarist https://gist.github.com/unarist/3134f59953569a4a8ea692185b94eaeb
// @author nikolat https://gist.github.com/nikolat/c945aa7dce03dd86a43c947a32fb83b9
// @match https://tokimeki.blue/*
// @grant GM.xmlHttpRequest
// @homepage https://gist.github.com/nikolat/c945aa7dce03dd86a43c947a32fb83b9
// @downloadURL https://gist.github.com/nikolat/c945aa7dce03dd86a43c947a32fb83b9/raw/4d488784ae5c9a38ab4957a21239b7668da46ed5/bluesky-sstp-over-http.user.js
@nikolat
nikolat / _main.md
Last active May 5, 2022 23:41 — forked from steve02081504/_main.md
How to get your ghost to support Discord Rich Presence
// http://d.hatena.ne.jp/fumokmm/20110822/1314013182
// ローマ数字定義
def romans = [
I :1 ,
IV:4 , V:5 , IX:9 , X:10 ,
XL:40 , L:50 , XC:90 , C:100 ,
CD:400, D:500, CM:900, M:1000
]
// シンボル化能力を追加
@nikolat
nikolat / dropStartsSameTest.groovy
Created August 20, 2011 02:17 — forked from fumokmm/dropStartsSameTest.groovy
お題:文字列を先頭から見て同じところまで除去
// http://d.hatena.ne.jp/fumokmm/20110812/1313138407
def dropStartsSame(String... args) {
if (args.any{!it}) return args
args*.substring(
args*.toList().transpose().with{
def i=0; it.collect{[i++, it]}
}.with{ dup ->
dup.find{ it[1].unique().size() != 1 }.with {
it ? it[0] : dup.last()[0]+1
}
@nikolat
nikolat / fizzBuzzN.groovy
Created August 18, 2011 14:09 — forked from fumokmm/fizzBuzzN.groovy
お題:FizzBuzz(Nパターン) solved by Groovy
// http://d.hatena.ne.jp/fumokmm/20110815/1313405510
def fizzBuzzN(nums, list) {
def toMap = { lst -> (0..<lst.size()/2).collectEntries{ lst[it*2..it*2+1] } }
toMap(list).collect{ k, v ->
v = nums.collect{ it % k == 0 ? v : '' }
}.transpose()*.join().eachWithIndex{ it, idx ->
println(it ? it : idx+nums.from)
}
}
fizzBuzzN(1..100, [3, 'Fizz', 5, 'Buzz', 7, 'Hoge'])
def array = []
def tmp = ""
array = ('0'..'9') + ('a'..'z') + ('A'..'Z') + '_'
(1..16).each {
tmp += array[Math.floor(Math.random() * array.size()) as int]
}
println tmp
@nikolat
nikolat / aaa.txt
Created January 8, 2011 14:13 — forked from fumokmm/aaa.txt
aaa
// ==UserScript==
// @name replace star by profile icon
// @namespace http://www.hatena.ne.jp/Nikola/
// @description replace star by profile icon (for Google Chrome8)
// @include http://*.hatena.ne.jp/*
// @version 1.0.0
// ==/UserScript==
(function () {
var executeBrowserContext = function(funcOrString) {
// ==UserScript==
// @name Hatena Haiku notify auto opener
// @namespace http://www.hatena.ne.jp/Nikola/
// @description はてなハイク1.1の新着通知を自動で開きます。Google Chromeにも対応。
// @include http://h1beta.hatena.ne.jp/*
// @include http://h1beta.hatena.com/*
// ==/UserScript==
(function () {