Skip to content

Instantly share code, notes, and snippets.

View jkazimierczak's full-sized avatar

jkazimierczak

View GitHub Profile
@jkazimierczak
jkazimierczak / README.md
Created December 9, 2023 22:48
A simple spacing generator for figma token-studio from TailwindCSS spacing table: https://tailwindcss.com/docs/customizing-spacing#default-spacing-scale

TailwindCSS design token generator

A simple design token generator for Token Studio for Figma from TailwindCSS spacing table.

https://tailwindcss.com/docs/customizing-spacing#default-spacing-scale

First open devtools and select spacing table, right click on it and select "Use in console". This will create a temporary variable. The name may vary, so update the script accordingly (defaults to temp0). Then execute the script in the browser console, copy and paste JSON into JSON editor of Token Studio for Figma and voila!

image

@jkazimierczak
jkazimierczak / reset.css
Created July 8, 2023 10:18
Kevin Powell CSS Reset
/* Base */
*, *::before, *::after {
box-sizing: border-box;
}
img, picture, svg, video {
display: block;
max-width: 100%;
}
@jkazimierczak
jkazimierczak / .gitignore
Created March 14, 2023 21:19
Python + PyCharm (Jetbrains) .gitignore
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea
# *.iml
# *.ipr
# CMake
@jkazimierczak
jkazimierczak / script.py
Created September 26, 2022 23:44
time.perf_counter()
import time
start_time = time.perf_counter()
# Code to measure execution time
print(f"measured_code took {time.perf_counter() - start_time}")
@jkazimierczak
jkazimierczak / presences.py
Created August 16, 2021 19:22
A presence status mapper for League of Legends Discord activity.
"""
Author: Jakub Kazimierczak
Created: 2021/08/16
License: MIT
This module contains an enum of Discord Presence statuses for the
League of Legends. There is also a mapper, that returns an adequate
enum member for a given activity status string.
Big thanks to Arjan Codes Discord members, namely @MellexPro and
@jkazimierczak
jkazimierczak / models.py
Last active August 13, 2021 20:27
SELECT JOIN - tortoise-orm
from tortoise import fields, Model
class Person(Model):
id = fields.IntField(pk=True)
name = fields.TextField()
def __str__(self):
return self.name
@jkazimierczak
jkazimierczak / script.py
Created July 11, 2021 18:36
Controlling Windows Media with pywin32
from win32api import keybd_event
from win32con import VK_MEDIA_PLAY_PAUSE, VK_MEDIA_PREV_TRACK, VK_MEDIA_NEXT_TRACK, VK_VOLUME_UP, VK_VOLUME_DOWN, VK_VOLUME_MUTE
class MediaControl:
@staticmethod
def play_pause():
keybd_event(VK_MEDIA_PLAY_PAUSE, 0)
@staticmethod