Skip to content

Instantly share code, notes, and snippets.

View k1832's full-sized avatar
๐ŸŸ
I'm lovin' it

Keita Morisaki k1832

๐ŸŸ
I'm lovin' it
View GitHub Profile

Keybase proof

I hereby claim:

  • I am k1832 on github.
  • I am k1832 (https://keybase.io/k1832) on keybase.
  • I have a public key ASC4nsDVuJ6CHf_V3k4NbHfGa8KIG35Jq11uBfFGaJLCego

To claim this, I am signing this object:

@k1832
k1832 / prime-dates.py
Created August 28, 2021 12:39
This script satisfies my curiosity by listing prime dates. Inspired by this tweet (https://twitter.com/masu1017/status/1431589271568216065?s=20).
def is_prime(n):
if n <= 1: return False
if n == 2: return True
if not n%2: return False
i = 3
while i*i <= n:
if not n%i: return False
i+=2
return True
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
num_trials=1000
for i in `seq 1 $num_trials`
do
echo trial $i
input=$(python input_generator.py)
expected=$(echo "$input" | python solve_naively.py)
actual=$(echo "$input" | python solve.py)
// ==UserScript==
// @name AtCoder - You're top X%
// @namespace https://gist.github.com/k1832/9438a1469bb2fa94d26702e1556aff97
// @version 1.1
// @description Displays your approximate ranking percentile among all active AtCoder users on your profile page.
// @author k1832
// @match https://atcoder.jp/users/*
// @license MIT License, Copyright (c) 2024 Keita Morisaki
// @grant GM_xmlhttpRequest
// ==/UserScript==