Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tatzyr's full-sized avatar
🍹

Tatsuya Otsuka tatzyr

🍹
View GitHub Profile
@tatzyr
tatzyr / image.md
Last active July 5, 2023 12:19
Markdownで画像を表示する

Markdownで画像を表示する

Markdownでは文書中に画像ファイルを表示することができる。GitHubでReadmeに使うと見栄えがいい。

エビフライトライアングル

Markdown記法で書くならこんな感じ。"サンプル"の部分は省略可能。

![エビフライトライアングル](http://i.imgur.com/Jjwsc.jpg "サンプル")
// ==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==
rand(0x10000000000000000000000000000).to_s(32).tr('0-9a-z', 'A-Z2-7').rjust(23, 'A')
@tatzyr
tatzyr / loadsleep
Created March 20, 2017 12:07
loadaverage sleep
#!/usr/bin/env ruby
require "optparse"
opts = ARGV.getopts("", "minutes:5", "load:", "help", "version")
if opts["help"]
puts <<EOS
loadsleep
@tatzyr
tatzyr / jsontop
Created March 20, 2017 12:04
JSON output for top (1)
#!/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']}" : ""
---
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
#!/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"
#!/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)
#!/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
@tatzyr
tatzyr / csv-split.cpp
Created June 21, 2013 13:42
カンマなどで区切られたstringを分割。ダブルクォートや連続したカンマは解釈しない簡易版。
#include <iostream>
#include <vector>
#include <string>
using namespace std;
// カンマなどで区切られたstringを分割
vector<string> split(const string line, const string delim)
{
vector<string> result;