Skip to content

Instantly share code, notes, and snippets.

View simin75simin's full-sized avatar

simin75simin

View GitHub Profile
from sympy import *
for n in range(2,14):
r=1
for p in primerange(n+1):
q=1
x=0
while p**q<=n:
x+=n//(p**q)
q+=1
r*=(x+1)
@simin75simin
simin75simin / 2015.ipynb
Created October 31, 2024 14:16
Some questions from Advent of Code 2015 (including 25 and 24 part 2)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simin75simin
simin75simin / vim-social-media.js
Created October 27, 2024 07:36
vim keybindings to navigate social media (currently 9gag, new reddit). j to go down, k to go up, l to like, d to downvote.
// ==UserScript==
// @name Post Navigation with J, K, L, and D (Reddit & 9GAG)
// @namespace http://tampermonkey.net/
// @version 1.3
// @description Use J and K keys to navigate, L to like, and D to downvote posts on Reddit (new layout) and 9GAG
// @match https://www.reddit.com/*
// @match https://9gag.com/*
// @grant none
// ==/UserScript==
@simin75simin
simin75simin / my_agent.py
Created October 11, 2024 13:11
simple 2048 agent with 80 percent winrate by simulation
# to use, pip install gymnasium-2048 first then replace the second file in the package
from typing import List
import gymnasium as gym
from tqdm import trange
import numpy as np
np.random.seed(0)
import pandas as pd
from copy import deepcopy
from multiprocessing import Pool, cpu_count
@simin75simin
simin75simin / peoeis.ipynb
Last active August 4, 2024 10:04
PE-oeis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simin75simin
simin75simin / euler271.ipynb
Last active June 10, 2024 13:00
solves projectEuler 271
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simin75simin
simin75simin / lemmy_top_comment.js
Created September 20, 2023 11:49
lemmy show top comment userscript
// ==UserScript==
// @name lemmy show top comment
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://lemmy.*/post*
// @icon https://www.google.com/s2/favicons?sz=64&domain=lemmy.world
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
@simin75simin
simin75simin / pointcloud_align_pair.py
Last active June 5, 2022 08:01
pointcloud verifier
from icecream import ic
import open3d as o3d
import sys
import os
import numpy as np
import pickle
from copy import deepcopy
if len(sys.argv) != 4:
# base folder, image 1, image 2
from tqdm import tqdm
import subprocess
import sys
import os
from multiprocessing import Pool, cpu_count, Manager
from time import perf_counter
if len(sys.argv) != 3:
print('usage: gen_res.py /path/to/image /path/to/output')
@simin75simin
simin75simin / clear.sh
Created December 9, 2021 02:37
3DScan directory cleaning program
rm -rf /home/<username>/3DScan/depth
rm -rf /home/<username>/3DScan/color
mkdir /home/<username>/3DScan/depth
mkdir /home/<username>/3DScan/color