Skip to content

Instantly share code, notes, and snippets.

import os
import random
import time
import json
import math
from typing import Iterable, List, Set, Tuple
from urllib.request import urlopen
# ゲームサーバのアドレス / トークン
GAME_SERVER = os.getenv('GAME_SERVER', 'https://contest.2021-autumn.gbc.tenka1.klab.jp')
const $ = (selector: string): HTMLElement => document.querySelector(selector)!
const $$ = (selector: string): HTMLElement[] =>
Array.from(document.querySelectorAll(selector))
type Coord = { x: number; y: number }
type Nyan = { pos: Coord; point: number }
const plusCoord = (pos1: Coord, pos2: Coord): Coord => {
return { x: pos1.x + pos2.x, y: pos1.y + pos2.y }
}
@Gobi03
Gobi03 / toggl-project-name-extractor.js
Created June 4, 2021 05:05
Toggl にプロジェクト名コピーボタンを生やす
// ==UserScript==
// @name toggl project name extractor
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Toggl にプロジェクト名コピーボタンを生やす
// @author t.katsushima
// @match https://track.toggl.com/timer
// @icon https://www.google.com/s2/favicons?domain=toggl.com
// @grant GM.setClipboard
// ==/UserScript==
use std::fs;
use std::io::Write;
#[derive(Clone)]
struct Graphics {
screen_w: f64,
screen_h: f64,
data: String,
@Gobi03
Gobi03 / dssisisin-ai-starter-kit.js
Created May 8, 2020 06:09
https://digital-shift-sisisin.unubo.app/ の操作 AI のスターターキット。ランダムジャンプするAIと、基本操作一式が入っている。
// Digital Shift Sisisin の操作AI
//
// 座標は { x: number; y: number } で表現する
// x座標は右がプラス、y座標は下がプラス
// sisisinのy座標は常に0
// フィールドオブジェクトElement達の取得
const rocks = document.getElementsByClassName('rock')
const p1chips = document.getElementsByClassName('point')
const p10chips = document.getElementsByClassName('daisuke')
@Gobi03
Gobi03 / esa-exclude-filter.js
Created March 22, 2020 06:37
esa 画面に除外フィルタを生やす
// ==UserScript==
// @name esa 除外フィルタ
// @namespace http://tampermonkey.net/
// @version 0.1
// @description .
// @author @Gobi03
// @match https://opt-technologies.esa.io/members/*
// @match https://opt-technologies.esa.io/*
// @grant none
// ==/UserScript==
@Gobi03
Gobi03 / kintai-automator.js
Last active March 29, 2020 06:03
勤怠入力を自動化するやつ
// ==UserScript==
// @name kintai-automator
// @namespace http://tampermonkey.net/
// @version 0.2
// @description .
// @author https://github.com/Gobi03
// @match https://opthd--teamspirit.visualforce.com/apex/AtkWorkTimeView?sfdc.tabName=01r100000001yyc
// @grant none
// ==/UserScript==
#!/usr/bin/env python3
"""
辺をランダムに取得し、点数を計算するサンプルプログラムです。
実行には python3 環境が必要です。
TOKEN 変数を書き換えて実行してください。
"""
import heapq
import queue
@Gobi03
Gobi03 / 15-sisisin-BeamSearch.scala
Last active November 1, 2019 15:45
社内勉強会用、ビームサーチの例
import java.util.Scanner
import scala.xml.XML
import scala.collection.mutable.{PriorityQueue, Set}
import scala.util.control.Breaks.{breakable,break}
import Math.abs
/** <div.board> を入力として与える **/
object Main extends App with Tools {
@Gobi03
Gobi03 / 15-sisisin-bfs.scala
Last active November 1, 2019 02:47
社内勉強会用BFSの例。終わらないので注意。
import java.util.Scanner
import scala.xml.XML
import scala.collection.mutable.Queue
import scala.util.control.Breaks.{breakable,break}
/** <div.board> を入力として与える **/
object Main extends App with Tools {
override val H = 4