Skip to content

Instantly share code, notes, and snippets.

View akameco's full-sized avatar

akameco akameco

  • Japan, Tokyo
View GitHub Profile
@akameco
akameco / nice_rock.rb
Last active December 20, 2015 01:19
ロックスターに即座にナイスロックするプラグイン
# -*- coding: utf-8 -*-
Plugin.create :nice_rock do
on_appear do |ms|
ms.each do |m|
if m.message.to_s =~ /ロックスター/
str ="@#{m.user.idname}" + " ナイスロック"
Service.primary.post(:message => str, :replyto => m)
end
end
end
@akameco
akameco / fackin_hot.rb
Last active December 20, 2015 03:28
ファッキンホット!
# -*- coding: utf-8 -*-
Plugin.create(:fackin_hot) do
on_appear do |ms|
ms.each do |m|
if m.message.to_s =~ /^暑い/
str = "@#{m.user.idname}" + " ファッキンホット"
Service.primary.post(:message => str, :replyto => m)
end
end
# coding: utf-8
require "rubygems"
require "nokogiri"
require "open-uri"
require "kconv"
require "time"
def tenki
time = Time.new
doc = Nokogiri::HTML(open("http://tenki.jp/forecast/point-702.html"))
@akameco
akameco / update_name.rb
Created May 13, 2014 07:15
アップデートネーム
# coding: utf-8
require 'rubygems'
require 'twitter'
CONSUMER_KEY = 'APIキー'
CONSUMER_SECRET = 'APIシークレットキー'
ACCESS_TOKEN = 'アクセストークン'
ACCESS_TOKEN_SECRET = 'アクセストークンシークレット'
client = Twitter::REST::Client.new do |config|
@akameco
akameco / fizzbuzz.rb
Last active August 29, 2015 14:05
rubyでfizzbuzz
# coding: utf-8
fizz = -> (n) { n % 3 == 0 }
buzz = -> (n) { n % 5 == 0 }
fizzbuzz = -> (n) { fizz.call(n) and buzz.call(n) }
(1..30).each do |v|
case v
when fizzbuzz
puts "fizzbuzz"
@akameco
akameco / selector_fi.user.js
Created December 4, 2014 15:00
コピペを楽に
// ==UserScript==
// @name selector_fi
// @namespace https://twitter.com/akameco
// @include http://www.cue.im.dendai.ac.jp/*
// @include https://www.mlab.im.dendai.ac.jp/*
// @include http://www.mlab.im.dendai.ac.jp/*
// @version 1
// @grant none
// ==/UserScript==
(function () {
@akameco
akameco / font-stylish.css
Created December 6, 2014 09:23
webフォント対策
@font-face {
font-family: "MS Pゴシック";
src: local("");
}
@font-face {
font-family: "MS PGothic";
src: local("");
}
@akameco
akameco / vimperatorrc
Last active August 29, 2015 14:11
半画面にリサイズで自動でツリー型タブを閉じる
" ツリー型タブの自動開閉 {{{
js <<EOM
var timer=false;
window.addEventListener('resize',function () {
if(timer !== false) {
clearTimeout(timer);
}
timer = setTimeout(function() {
if(window.outerWidth < 700) {
if(TreeStyleTabService.isAutoHide == 0)
@akameco
akameco / SamplePlayer.java
Last active August 29, 2015 14:12
mp3再生
import javazoom.jlgui.basicplayer.BasicPlayer;
import javazoom.jlgui.basicplayer.BasicPlayerException;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
public class SamplePlayer extends JPanel {
BasicPlayer player;
package compilir;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Calculator {
// 変数の名前と値の組を格納する HashMap (値は整数限定)
private HashMap<String, Double> symbolMap;