Skip to content

Instantly share code, notes, and snippets.

Avatar
🍹

Tatsuya Otsuka tatzyr

🍹
View GitHub Profile
View ma.js
// ==UserScript==
// @name Auto Accept △ Complex
// @namespace https://github.com/tatzyr/
// @version 0.1.0
// @description Auto Accept △ Complex
// @include https://www.sankakucomplex.com/mature-content-disclaimer/*
// @match https://www.sankakucomplex.com/mature-content-disclaimer/*
// @run-at document-end
// @copyright 2018, Tatzyr
// ==/UserScript==
View base32.rb
rand(0x10000000000000000000000000000).to_s(32).tr('0-9a-z', 'A-Z2-7').rjust(23, 'A')
@tatzyr
tatzyr / loadsleep
Created Mar 20, 2017
loadaverage sleep
View loadsleep
#!/usr/bin/env ruby
require "optparse"
opts = ARGV.getopts("", "minutes:5", "load:", "help", "version")
if opts["help"]
puts <<EOS
loadsleep
@tatzyr
tatzyr / jsontop
Created Mar 20, 2017
JSON output for top (1)
View jsontop
#!/usr/bin/env ruby
require "optparse"
require "json"
require "open3"
params = ARGV.getopts("cu:")
c_opt = params["c"] ? "-c" : ""
u_opt = params["u"] ? "-u #{params['u']}" : ""
View parrot.yml
---
title: parrotparty
emojis:
- name: parrot
src: http://cultofthepartyparrot.com/parrots/parrot.gif
- name: middleparrot
src: http://cultofthepartyparrot.com/parrots/middleparrot.gif
- name: rightparrot
src: http://cultofthepartyparrot.com/parrots/rightparrot.gif
- name: aussieparrot
View glass.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
require "mechanize"
require "uri"
list_urls = [
"https://www.plusalpha-glass.net/index.php?lang_id=ja&genre_id=&keyword=&sch_goods_tag=&act=&sortkey=&offset=0&tsuka_conv=jpy",
"https://www.plusalpha-glass.net/index.php?lang_id=ja&genre_id=&keyword=&sch_goods_tag=&act=&sortkey=&offset=60&tsuka_conv=jpy",
"https://www.plusalpha-glass.net/index.php?lang_id=ja&genre_id=&keyword=&sch_goods_tag=&act=&sortkey=&offset=120&tsuka_conv=jpy"
View dynmap-players.rb
#!/usr/bin/env ruby
# require "headless"
require "capybara"
require "capybara-webkit"
class Capybara::Session
def wait_css(selector, timeout_sec = 5)
timeout_sec.times do
break if has_css?(selector)
View snowball.sh
#!/bin/bash
max=50
for ((i=0; i < $max; i++)); do
# Minecraftのウインドウを選択
cliclick c:280,760
sleep 0.1
# 1行1列のアイテム選択
cliclick c:280,760
View jdxv.rb
#!/usr/bin/env ruby
EXCLUDE_DIRECTORY_PATTERN = /\A\d{4}-\d{2}-\d{2}\z/
files = Dir["*/*"].reject {|filename|
File.dirname(filename).match(EXCLUDE_DIRECTORY_PATTERN)
}
directories = Dir["*"].reject {|dirname|
dirname.match(EXCLUDE_DIRECTORY_PATTERN)
@tatzyr
tatzyr / csv-split.cpp
Created Jun 21, 2013
カンマなどで区切られたstringを分割。ダブルクォートや連続したカンマは解釈しない簡易版。
View csv-split.cpp
#include <iostream>
#include <vector>
#include <string>
using namespace std;
// カンマなどで区切られたstringを分割
vector<string> split(const string line, const string delim)
{
vector<string> result;