Skip to content

Instantly share code, notes, and snippets.

View Kogia-sima's full-sized avatar

Kogia-sima Kogia-sima

View GitHub Profile
@Kogia-sima
Kogia-sima / selenium_auto_purchase.py
Last active February 26, 2021 18:23
Selenium auto purchase
import chromedriver_binary # noqa
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located
def monitor_value(driver):
element = driver.find_element(By.CSS_SELECTOR, 'span.amount')
if element is not None and int(element.get_attribute('innerHTML')) <= 600:
@Kogia-sima
Kogia-sima / ガウス積分の数値計算.md
Last active January 31, 2021 21:43
Calculate numerical integration of normal distribution

概要

以下の積分値を数値計算により導出する

手法

x = (1 - t) / tという変数変換を行うことで、下式を得る。

import os
import re
import sys
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import pandas as pd
import seaborn as sns
sns.set(style='darkgrid')
sns.set(font_scale=1.0)
@Kogia-sima
Kogia-sima / bench.rs
Last active November 1, 2020 06:05
Vec::drain benchmark
#![feature(test)]
extern crate test;
use test::{Bencher, black_box};
type Item = u8;
const TOTAL_SIZE: usize = 10000;
const COPY_SIZE: usize = 1000;
#[bench]
@Kogia-sima
Kogia-sima / Cargo.toml
Created July 19, 2020 20:15
Calculate first 10000 digits of π
[package]
name = "pi"
version = "0.1.0"
authors = ["Kogia-sima <orcinus4627@gmail.com>"]
edition = "2018"
[dependencies]
rug = "1.9.0"
@Kogia-sima
Kogia-sima / cargo-flamegraph
Last active December 18, 2019 04:54
Generate flamegraph for Rust project with sudo and perf
#!/bin/bash
#
# Generage Flamegraph for Rust project with sudo and perf
# Copyright (c): 2019 Kogia-sima <orcinus4627@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@Kogia-sima
Kogia-sima / .conkyrc
Last active May 22, 2019 21:26
flair theme with conky 1.10.8
-- vim:set expandtab ts=2 sw=2 syntax=lua:
conky.config = {
background = false,
use_xft = true,
xftalpha = 0.8,
update_interval = 1,
own_window = true,
own_window_class = 'Conky',
own_window_type = 'desktop',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',