Skip to content

Instantly share code, notes, and snippets.

View KevinGutowski's full-sized avatar

Kevin Gutowski KevinGutowski

View GitHub Profile
@KevinGutowski
KevinGutowski / crop_pokemon_cards.bat
Created June 16, 2026 06:46
Simple script to crop pokemon card images
@echo off
setlocal EnableExtensions EnableDelayedExpansion
rem Pokemon card cropper for Windows.
rem Usage:
rem 1. Drag image files or folders onto this .bat
rem 2. Or put this .bat in a folder with images and double-click it
rem
rem Cropped PNGs are written to a "cropped" folder next to this .bat.
@KevinGutowski
KevinGutowski / autolabel.scpt
Created December 5, 2025 22:28
Autolabel screenshots
on run {input, parameters}
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
end tell
if frontApp is not "Google Chrome" and frontApp is not "Safari" then
return input
end if
set theURL to ""
@KevinGutowski
KevinGutowski / parseDeckstring.js
Created April 6, 2023 05:56
Parse Pokémon Trading Card Online Deckstring
function importDeckString(deckString) {
var lines = deckString.trim().split('\n');
lines = lines.filter(item => item !== "");
lines.pop()
const cards = [];
var numOfPokemon = 0
var numOfTrainers = 0
var numOfEnergy = 0
@KevinGutowski
KevinGutowski / parseCard.py
Created April 3, 2023 05:03
Parse a card from Pokemon-card.com (output a JSON file)
import os
import sys
import requests
import bs4
import json
if len(sys.argv) < 2:
print("Please provide a URL as input")
sys.exit(1)
@KevinGutowski
KevinGutowski / parse.py
Created March 21, 2023 21:24
Parse a japanese pokemon card
baseURL = 'https://www.pokemon-card.com'
def parseSoup(soup):
topHeadings = soup.find_all('h2')
leftBox = soup.find(class_='LeftBox')
rightBox = soup.find(class_='RightBox')
topInfo = soup.find(class_='TopInfo')
atr = {
'name':'',
'cardClass': '', # "ポケモン, Trainer, エネルギー"
@KevinGutowski
KevinGutowski / exportCSV.js
Last active October 11, 2022 22:30
PKMNCards to CSV
let main = document.getElementById('genesis-content')
let headings = main.getElementsByClassName('headings')[0]
let headingText = Array.from(headings.children).map(el=>el.innerText.split(":")[0].replace("\n","")).join(',')
let article = Array.from(main.getElementsByTagName('article'))
let rowTextArray = article.map(el=>{
let columns = Array.from(el.getElementsByClassName('column'))
return columns.map(el=>el.innerText.replace('\n',"")).join(',')
@KevinGutowski
KevinGutowski / reorder.py
Created January 7, 2022 21:17
Reorder pandas column using indexes
columns = list(df.columns)
df = df[[columns[i] for i in [3,2,1,4,6,4,8]]
@KevinGutowski
KevinGutowski / hide.js
Created November 12, 2021 05:28
Hide Connector Nodes
let connectors = figma.currentPage.children.filter(layer=>layer.type=="CONNECTOR")
connectors.forEach(layer=>{layer.visible = false})
@KevinGutowski
KevinGutowski / resizeProgressBars.js
Created October 13, 2021 21:34
Resize widths of progress bars - Figma
let selection = figma.currentPage.selection[0]
let paddingWidth = selection.paddingLeft + selection.paddingRight
let insetWidth = selection.width - paddingWidth
let times = [60*10+10,60*10+22,60*12+42,60*13+59]
// Remove extra children
selection.children.forEach((e,i)=>{
if (i>0) {
e.remove()
}
@KevinGutowski
KevinGutowski / resizeTo16by9.js
Created October 13, 2021 21:33
16:9 - Figma
let selection = figma.currentPage.selection
let width = selection[0].width
let height = selection[0].height
let multiplier = Math.floor(width/16)
selection[0].resize(16*multiplier,9*multiplier)
selection[0].constrainProportions = true