Skip to content

Instantly share code, notes, and snippets.

@sasamijp
sasamijp / tenki.rb
Created October 3, 2013 12:55
macでweather_jpいれてkyokoさんに設定すると動くと思います
# -*- encoding: utf-8 -*-
require 'rubygems'
require 'weather_jp'
local = WeatherJp.get gets.to_s
system("say #{local.today.to_s}")
@sasamijp
sasamijp / teraari.rb
Last active December 26, 2015 02:59
てらありw
# -*- encoding: utf-8 -*-
n = 0
input = gets.to_i
while n < input do
print "「"
print "てら"
n.times do
print "あり"
end
print "w」"
@sasamijp
sasamijp / namechanger.rb
Created November 24, 2013 14:47
前Anonymousで公開してた
# -*- encoding: utf-8 -*-
require 'rubygems'
require 'tweetstream'
require 'twitter'
require './key.rb'
Twitter.configure do |config|
config.consumer_key = Const::CONSUMER_KEY
config.consumer_secret = Const::CONSUMER_SECRET
config.oauth_token = Const::ACCESS_TOKEN
@sasamijp
sasamijp / prime.rb
Last active January 1, 2016 22:08
あけおめ
# -*- encoding: utf-8 -*-
require 'prime'
def printPrime(num)
print "                                    ====== ___======
            ,, -―-、         _====_==== ̄ ̄== ̄ ̄     ̄ ̄ ̄
          /     ヽ  _─==三≡≡ ̄==
    / ̄ ̄/  /i⌒ヽ、| _== ̄
   /  ●/   / /     ̄
  /     ト、.,../ ,ー-、    _人人人人人人人人人人人人人人人_
@sasamijp
sasamijp / ユークリッド.rb
Last active January 3, 2016 13:09
最大公約数
input=gets.split
r=input[0].to_i%input[1].to_i
until r==0 do
m=n
n=r
r=m%n
puts n
end
@sasamijp
sasamijp / datetoDay.rb
Last active August 29, 2015 13:56
トイレ行きたい
# -*- encoding: utf-8 -*-
def datetoDay(str)
inputs = str.split
y = inputs[0].to_i
m = inputs[1].to_i
d = inputs[2].to_i
if m < 3
y -= 1
@sasamijp
sasamijp / SiritoriAI.rb
Last active August 29, 2015 13:57
しりとりしましょ
# -*- encoding: utf-8 -*-
require 'natto'
require 'twitter'
require 'tweetstream'
require './key.rb'
@rest = Twitter::REST::Client.new do |config|
config.consumer_key = Const::CONSUMER_KEY
config.consumer_secret = Const::CONSUMER_SECRET
config.access_token = Const::ACCESS_TOKEN
config.access_token_secret = Const::ACCESS_TOKEN_SECRET
@sasamijp
sasamijp / dump.rb
Last active August 29, 2015 13:57
ミキ的にはこのコード、エロいものかそうでないかのスコアを出すには全然合ってないって思うな
# -*- encoding: utf-8 -*-
require 'natto'
@natto = Natto::MeCab.new
def getSS
sentenses = []
File.read("./ss.txt", :encoding => Encoding::UTF_8).split("\n").each do |str|
sentenses.push str if str.include?("「") and str.include?("」")
end
sentenses.map! do |sentense|
@sasamijp
sasamijp / main.rb
Created April 2, 2014 15:03
天海春香さん生誕祭カウントダウンプログラムを作り忘れてて30分前に慌てて書いた
# -*- encoding: utf-8 -*-
require 'tweetstream'
require 'twitter'
require 'date'
require './key.rb'
rest = Twitter::REST::Client.new do |config|
config.consumer_key = Const::CONSUMER_KEY
config.consumer_secret = Const::CONSUMER_SECRET
config.access_token = Const::ACCESS_TOKEN
config.access_token_secret = Const::ACCESS_TOKEN_SECRET
@sasamijp
sasamijp / colorbox.pde
Created April 14, 2014 07:12
回る箱
RollingBox box3d;
float counter;
void setup(){
size(500, 800, P3D);
box3d = new RollingBox();
counter = 0;
frameRate(60);
}