Skip to content

Instantly share code, notes, and snippets.

View newtykip's full-sized avatar
🦀
hi guys

newt :D newtykip

🦀
hi guys
View GitHub Profile
@newtykip
newtykip / fullAdder.py
Last active May 2, 2023 15:44
one-line full adder
i,r,z,l,g,a=int,range,bin,len,lambda x,m,b:(y:=list(map(lambda t:i(t),("0"if(x>=0)else"1")+z(x&m)[2:])),[y.insert(0,0)for _ in r(100)if l(y)<b],y)[2],lambda x,y:(b:=max(l(z(x)[2:]),l(z(y)[2:]))+1,m:=i("1"*b,2),p:=g(x,m,b),q:=g(y,m,b),p.reverse(),q.reverse(),w:=0,o:=[(w^(a^b),w:=(a&b)|(w&((~a&b)|(a&~b))))[0]for(a,b)in zip(p,q)],o.append(w)if(x>0)and(y>0)else(),o.reverse(),(s:=0 if(o[0]==0)else-(2**(l(o)-1)),o.pop(0),o.reverse(),[s:=s+(2**i if(o[i]==1)else 0)for(i)in r(l(o))][-1])[3])[10]
print(a(5,-6))
@newtykip
newtykip / scraper.py
Created February 14, 2023 03:15
Selenium scraper that can fetch information about books given a list of Amazon URLs
from selenium.webdriver import Chrome
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup
from xlsxwriter import Workbook
from time import sleep
# Fetch all of the URLs
urls = []
errors = []
@newtykip
newtykip / config.yaml
Last active January 26, 2023 13:11
Battleships.py default settings!
username: ~
ships:
- name: 'Battle'
size: 5
quantity: 1
- name: 'Crusier'
size: 4
quantity: 1

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@newtykip
newtykip / importer.bat
Last active January 26, 2023 13:11
Bulk import osu! replays
@echo off
@tasklist /nh /fi "imagename eq osu!.exe" | find /i "osu!.exe" > nul || "osu!.exe"
for %%x in (%userprofile%\AppData\Local\osu!\Data\r\*.osr) do (
start %%x
timeout /t 1 /nobreak >nul
)