Skip to content

Instantly share code, notes, and snippets.

View tai-cha's full-sized avatar

taichan tai-cha

View GitHub Profile
PFont myFont;
int size = 30;
Ball balls[] = new Ball[20];
void setup() {
size(480, 480);
background(255, 255, 255);
fill(0, 0, 0);
noStroke();
frameRate(90);
myFont = createFont("YuGothic", 24, true);
int num_circle = 200;
void setup(){
size(720,720);
background(255);
noStroke();
}
int counter = 0;
void draw(){
@tai-cha
tai-cha / hide_sejuku_net.js
Last active August 15, 2020 09:54
Hide result which include www.sejuku.net on Google Search (GreaseMonkey/userChrome.js Script)
// ==UserScript==
// @name Hide www.sejuku.net from google search
// @version 2
// @include *://google.co.jp/search*
// @include *://www.google.co.jp/search*
// @include *://google.com/search*
// @include *://www.google.com/search*
// ==/UserScript==
for (let elem of document.getElementsByClassName("g")){if(elem.innerHTML.match(/www.sejuku.net/)){elem.style.display="none"}};
@tai-cha
tai-cha / winc_shortner.js
Last active February 8, 2019 12:44
kitの宣言を楽にしてくれるであろうもの
const dom = (attribute) => {
return $("#winc" + _pid + " " + attribute);
}
@tai-cha
tai-cha / get_id_of_user_liked_tweet.rb
Last active March 16, 2019 17:39
特定のツイートにいいねした人のTwitterのidを抽出するメソッド(戻り値は数値の配列)
def get_id_of_user_liked_tweet(tweet_id)
json_data = Net::HTTP.get(URI.parse('https://twitter.com/i/activity/favorited_popup?id=' + tweet_id))
found_ids = json_data.scan(/data-user-id=\\"+\d+/)
found_ids.each{|str| str.slice!(/data-user-id=\\\"+/)}
found_ids = found_ids.map(&:to_i)
unique_ids = found_ids.uniq
return unique_ids
end
@tai-cha
tai-cha / fav_rt_followers.rb
Created March 16, 2019 17:42
ツイートid入れるとfavRTしたフォロワーを抽出するやつ
require 'twitter'
require 'net/http'
require 'json'
configFile = open('config.json') do |io|
JSON.load(io)
end
@client = Twitter::REST::Client.new do |config|
config.consumer_key = configFile['CK']
@tai-cha
tai-cha / shine.java
Created April 26, 2019 10:04
hex表示するやつ~~~~~~~~~~~~~~~~
String hex = String.format( "#%02X%02X%02X",
(int)( c.getRed() * 255 ),
(int)( c.getGreen() * 255 ),
(int)( c.getBlue() * 255 ) );
@tai-cha
tai-cha / gon.rb
Last active August 15, 2020 09:46
ゴン
def gon(num)
"ゴ" * num + "ン"
end
puts "回数を入力して下さい"
(1..readline.to_i).each{|i| puts gon i }
@tai-cha
tai-cha / insert.js
Created June 9, 2019 10:28
課題5の検証で毎回打つのめんどくさいから自動化した、コンソールにコピペでOK、データ変更は配列いじればOK
{
let data = [
["イギリス", 245, 63181, 2434],
["日本", 378, 126200, 4841],
["アメリカ", 9628, 327830, 20412],
["ロシア", 17098, 146804, 2097]
];
let form = document.forms[0];
let inputs = form.getElementsByTagName("input");
@tai-cha
tai-cha / ifSample1.pde
Last active June 12, 2019 13:14
ちょっとだけ出て消えるしかく
int count = 0; //カウント用変数
void setup(){
background(255,255,255);
size(480, 480);
stroke(0);
noFill();
}
void draw(){