拙作モロヘイヤ3.1以降がインストールされているMastodonインスタンスで、
#実況
タグを含むトゥートを表示したり隠したりします。
- マイクアイコンをクリックしてその内容をトゥートすると、実況ON。
- 斜線マイクアイコンをクリックしてその内容をトゥートすると、実況OFF。
function purgeMails () { | |
const days = 30 | |
const step = 500 | |
const labels = ['label:bulk'] | |
const date = new Date() | |
date.setDate(date.getDate() - days) | |
labels.map(label => { | |
let offset = 0 | |
let threads = GmailApp.search(label, offset, step) |
拙作モロヘイヤ3.1以降がインストールされているMastodonインスタンスで、
#実況
タグを含むトゥートを表示したり隠したりします。
#!/usr/bin/env ruby | |
require 'resolv' | |
require 'httparty' | |
require 'timeout' | |
File.read('./instances.txt').each_line(chomp: true) do |domain| | |
Timeout.timeout(10) do | |
Resolv::DNS.new.getaddress(domain) | |
code = HTTParty.get("https://#{domain}/about").code | |
raise '404' if code == 404 |
I hereby claim:
To claim this, I am signing this object:
dir = File.expand_path(__dir__) | |
namespace :cert do | |
desc 'update cert' | |
task :update do | |
require 'httparty' | |
File.write( | |
File.join(dir, 'cert/cacert.pem'), | |
HTTParty.get('https://curl.haxx.se/ca/cacert.pem'), | |
) |
module MulukhiyaTootProxy | |
class Config < Ginseng::Config | |
include Package | |
def self.deep_merge(src, target) | |
raise ArgumentError 'Not Hash' unless target.is_a?(Hash) | |
dest = (src.clone || {}).with_indifferent_access | |
target.each do |k, v| | |
dest[k] = v.is_a?(Hash) ? deep_merge(dest[k], v) : v | |
end |
module MulukhiyaTootProxy | |
class ConfigTest < Test::Unit::TestCase | |
def test_deep_merge | |
config = Config.deep_merge({}, {a: 111, b: 222}) | |
assert_equal(config, {'a' => 111, 'b' => 222}) | |
config = Config.deep_merge(config, {c: {d: 333, e: 444}}) | |
assert_equal(config, {'a' => 111, 'b' => 222, 'c' => {'d' => 333, 'e' => 444}}) | |
config = Config.deep_merge(config, {c: {e: 333, f: 444}}) | |
assert_equal(config, {'a' => 111, 'b' => 222, 'c' => {'d' => 333, 'e' => 333, 'f' => 444}}) | |
config = Config.deep_merge(config, {c: {d: nil}}) |
God.watch do |god| | |
god.name = 'growi' | |
god.env = { | |
'NODE_ENV' => 'production', | |
'MONGO_URI' => 'mongodb://localhost:27017/growi', | |
'PORT' => '3012', | |
'FILE_UPLOAD' => 'local', | |
'EIO_WS_ENGINE' => 'ws', | |
} | |
god.dir = '/home/pooza/growi' |
SELECT | |
accounts.id | |
FROM accounts | |
LEFT JOIN users ON accounts.id=users.account_id | |
LEFT JOIN ( | |
SELECT | |
account_id | |
FROM blocks | |
WHERE target_account_id=1 | |
) AS blockers ON accounts.id=blockers.account_id |
mastodon=# SELECT id,url,uri FROM statuses ORDER BY created_at DESC LIMIT 10; | |
id | url | uri | |
--------------------+-----------------------------------------------------+------------------------------------------------------------------- | |
101021706725789900 | https://mstdn.b-shock.org/@pooza/101021706465667821 | https://mstdn.b-shock.org/users/pooza/statuses/101021706465667821 | |
101021536613538389 | https://mstdn.b-shock.org/@pooza/101021536290247023 | https://mstdn.b-shock.org/users/pooza/statuses/101021536290247023 | |
101021359813439899 | https://mstdn.b-shock.org/@pooza/101021359533523455 | https://mstdn.b-shock.org/users/pooza/statuses/101021359533523455 | |
101020388883530247 | https://mstdn.b-shock.org/@pooza/101020385819933342 | https://mstdn.b-shock.org/users/pooza/statuses/101020385819933342 | |
101018448167948034 | https://mstdn.b-shock.org/@pooza/101018447922314499 | https://mstdn.b-shock.org/users/pooza/statuses/1 |