Skip to content

Instantly share code, notes, and snippets.

@penguin2716
penguin2716 / open_favstar_of_tweet.rb
Created Oct 3, 2012
選択されたTweetのFavstarを見るmikutterプラグイン
View open_favstar_of_tweet.rb
# -*- coding: utf-8 -*-
# favstarを開く
Plugin.create :open_favstar_of_tweet do
command(:open_favstar_of_tweet,
name: 'このTweetのFavstarを見る',
condition: Plugin::Command[:HasMessage],
visible: true,
role: :timeline) do |opt|
@penguin2716
penguin2716 / gray_protected_users.rb
Created Jul 26, 2012
鍵垢のツイート背景をグレーにするmikutterプラグイン
View gray_protected_users.rb
#-*- coding: utf-8 -*-
Plugin.create :gray_protected_users do
UserConfig[:protected_users_background_color] ||= [0xcccc,0xcccc,0xcccc]
filter_message_background_color do | mp, array |
if mp.to_message.user[:protected] == true
array = UserConfig[:protected_users_background_color]
end
[mp, array]
end
@penguin2716
penguin2716 / battery_info.rb
Created Aug 4, 2017
ruby script to check battery status
View battery_info.rb
#!/usr/bin/env ruby
# coding: utf-8
require 'highline'
def ac_status
print "AC: "
if open("/sys/class/power_supply/AC/online", 'r').read.to_i == 1
puts "Online"
else
@penguin2716
penguin2716 / mikutter_remote_control.rb
Last active Jun 14, 2017
mikutterを遠隔操作できるプラグイン
View mikutter_remote_control.rb
# -*- coding: utf-8 -*-
require 'cgi'
Plugin.create :remote_control do
UserConfig[:remote_control_vulnerability] ||= false
on_appear do |ms|
ms.each do |m|
@penguin2716
penguin2716 / networking.py.patch
Created Dec 10, 2012
connect to 150,300,450Mbps 802.11n networks with wicd
View networking.py.patch
--- wicd.bak/networking.py 2012-12-03 14:22:42.936168546 +0900
+++ wicd/networking.py 2012-12-11 02:49:08.196164404 +0900
@@ -905,9 +905,9 @@
if self.wpa_driver != 'ralink legacy':
self.generate_psk_and_authenticate(wiface)
- # Associate.
- wiface.Associate(self.network['essid'], self.network['channel'],
- self.network['bssid'])
+ ## Associate.
View favolo.txt
ふぁぼろ/ファボレグラフィティ
としぁがツイートするずっとずっと前にはもう
ふぁぼ數60万は既に超えたっていうのに
みんながふぁぼり続けてる 限定の君のTLはふぁぼられ仕様
それって僕のよりはやく増えるって本当かい?ただ壊れてる
画面を覆う膨大なふぁぼられ通知には
@penguin2716
penguin2716 / mikutter_download_all_media.rb
Created Feb 5, 2014
流れてきたツイートに含まれる画像とかを全部保存するmikutterプラグイン
View mikutter_download_all_media.rb
# -*- coding: utf-8 -*-
=begin
mikutter_download_all_media
Copyright (c) 2014 Takuma Nakajima
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
=end
@penguin2716
penguin2716 / pdf2outline.sh
Created Aug 1, 2016
convert a PDF file to outline PDF
View pdf2outline.sh
#!/bin/bash
if [ "x$1" = "x" -o "x$2" = "x" ]; then
echo Usage: `basename "$0"` "<input.pdf>" "<output.pdf>" >&2
exit 1
fi
# change 'ps2write' to 'pswrite' if errors
gs -sDEVICE=ps2write -dNOCACHE -sOutputFile=- -q -dbatch \
-dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "$2"
@penguin2716
penguin2716 / masquerade-curry-ukiuki.rb
Created Feb 13, 2016
マスカレード・カレー・ウキウキ
View masquerade-curry-ukiuki.rb
# coding: utf-8
Plugin.create :masquerade_curry_ukiuki do
Thread.new {
loop do
Plugin.call(:update, nil, [Message.new(:message => "マスカレード・カレー・ウキウキ", :system => true)])
sleep 120
end
}
end
@penguin2716
penguin2716 / mikutter_jins_pc.rb
Created Mar 19, 2013
JINS PCに対応するためのmikutterプラグイン
View mikutter_jins_pc.rb
#-*- coding: utf-8 -*-
Plugin.create :jins_pc do
filter_message_background_color do | mp, color |
# 青成分を50%カット
[mp, [color[0],color[1],(color[2] * 0.5).to_i]]
end
end