Skip to content

Instantly share code, notes, and snippets.

@syusui-s
syusui-s / mikutter_update_notify.rb
Last active October 5, 2015 02:22
TLに特定のユーザーのツイートが流れてきたら、ユーザー名とツイートを通知します。
# -*- coding: utf-8 -*-
Plugin::create(:update_notify) do
settings "ポスト通知" do
boolean "通知", :update_notify_bool
fileselect("通知音", :update_notify_sound, "skin/data/sounds")
input "ユーザー", :update_notify_users
end
onboot do
@syusui-s
syusui-s / mikutter.desktop
Created June 17, 2012 06:56
mikutter desktop file for Gentoo/Linux
[Desktop Entry]
Type=Application
Name=mikutter
GenericName=Twitter Client
Exec=mikutter
TryExec=mikutter
Icon=/usr/share/mikutter/core/skin/data/icon.png
Categories=Network;Internet;GTK
Path=/usr/share/mikutter/
@syusui-s
syusui-s / .gitignore
Last active December 12, 2015 02:08
make key, encrypt, decrypt (openssl)
rand.dat
private.key
public.key
# -*- coding: utf-8 -*-
require 'twitpic-full'
Plugin.create(:mikutter_twitpic_uploader) do
UserConfig[:twitpic_upimg] = ""
UserConfig[:twitpic_message] = ""
twitpic = TwitPic::Client.new()
twitpic.configure do |conf|
# 気にしたらいけない。
conf.api_key = "9b1d5ca2076eaa7029c83717dd641b47"
@syusui-s
syusui-s / problem1.hs
Created March 4, 2013 06:32
Project Euler in Haskell - Haskellの練習のためなので、結構適当
p1 = sum [x | x <- [1..999], x `mod` 3 == 0 || x `mod` 5 == 0])
@syusui-s
syusui-s / mikutterm.rb
Last active December 14, 2015 15:49
このプラグインを入れると、端末でmikutterが使えます。まだ色々実装できてません。 mikutter 0.2.2のcore/pluginにrestとtco、guiなどを残し、必要じゃなさそうなのを消していくと、それっぽく使えます。 Display Requirementに関しては、そもそも実装できないのでどうしようもない。
# -*- coding: utf-8 -*-
# mikutterm
# by syusui_s
require 'readline'
module Radix62
BASE = 62.freeze
@syusui-s
syusui-s / mikutter_plugin_updater.sh
Last active December 15, 2015 15:09
mikutterのプラグインをアップデートするやつ
# mikutterのプラグインって、たいがいgit cloneして導入するし、それぞれのフォルダでgit pullすればいいかなーって。
# 端末にコピペで動きますん
TMPPWD=$PWD;cd ~/.mikutter/plugin/;for x in $(for i in `ls -F`;do;echo $i|sed -ne "/\/$/p"|sed -e "s/\///g";done);do;echo -e "\e[32;1mtrying to update '$x'...\e[0m";cd $x;git pull;cd ..;done;cd $TMPPWD
@syusui-s
syusui-s / LICENSE
Last active December 15, 2015 20:41
[Ruby]putsする文字列に色を付けるやつ。シェルで、echo -e しても動いた。coloringの引数には、1つ目に文字列、2つ目以降に装飾・文字色・背景色(複数指定可)をString型で、カンマ区切りで指定する。ライセンスはMIT License
Copyright (c) 2013 Shusui MOYATANI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
# -*- coding: utf-8 -*-
Plugin.create :totsuzen_postbox do
def charwidth(char)
!(char =~ /[ぁ-ん]|[ァ-ヴ]|[一-龠]/) ? 1 : 2 end
def decolength(str)
str.split(//).map{|t|charwidth(t)}.inject{|sum,n|sum+n} end
def totsuzen(str)
@syusui-s
syusui-s / shuttle_run.sh
Created May 13, 2013 10:10
適当に作った
#!/bin/bash
MUTE="-n -f1 -l700";\
for i in 264 290 330 352 396 440 495 528;do
beep -f $i $MUTE
done
beep -f 130 -l 700 -n -f1 -l200
for i in 528 495 440 396 352 330 290 264;do
beep -f $i $MUTE
done