This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arr = [1,2,3,4] | |
#配列の要素が2か3にマッチしたら配列中のそれを消去 | |
arr.reverse_each do |item| | |
if ((item == 2) || (item == 3)) | |
arr.delete(item) | |
end | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup(){ | |
Serial.begin(9600); | |
pinMode(2, OUTPUT); | |
pinMode(4, OUTPUT); | |
pinMode(7, OUTPUT); | |
pinMode(8, OUTPUT); | |
} | |
void loop(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import copy | |
import serial | |
def main(): | |
text = "" | |
ser = serial.Serial() | |
#Arudinoの場所 | |
ser.port = '/dev/tty.usbmodem1411' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "twitter" | |
require 'open3' | |
OAUTH_token = "" | |
OAUTH_token_secret = "" | |
$user = Twitter::REST::Client.new do |config| | |
config.consumer_key = "" | |
config.consumer_secret = "" | |
config.access_token = OAUTH_token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s=%q{puts "s=%q{#{s}} | |
#{s}"} | |
puts "s=%q{#{s}} | |
#{s}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'slack-ruby-client' #-> 0.7.7 | |
#BOT用のトークンを設定 | |
TOKEN = ENV["SLACK_TOKEN"] | |
Slack.configure do |config| | |
config.token = TOKEN | |
end | |
client = Slack::RealTime::Client.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'slack-ruby-client' | |
TOKEN = ENV["SLACK_TOKEN"] | |
Slack.configure do |config| | |
config.token = TOKEN | |
end | |
client = Slack::RealTime::Client.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'slack-ruby-client' | |
require './func_google' | |
require './func_mecab' | |
TOKEN = ENV["SLACK_TOKEN"] | |
R18_LIST = File.foreach('wordlist.txt').map do |word| | |
word.chomp | |
end | |
R18_LIST.freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'slack-ruby-client' | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'logger' | |
TOKEN = ENV["SLACK_TOKEN"] | |
R18_LIST = File.foreach('wordlist.txt').map do |word| | |
word.chomp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mecab' | |
sentence = "ゲームしてからスケベしよう" | |
mecab = MeCab::Tagger.new | |
node = mecab.parseToNode(sentence) | |
word_array = [] | |
begin | |
node = node.next |