Skip to content

Instantly share code, notes, and snippets.

View senko's full-sized avatar

Senko Rašić senko

View GitHub Profile
@senko
senko / minesweeper.html
Created March 26, 2025 16:47
Minesweeper - single shot, Google Gemini 2.5 Pro
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Minesweeper</title>
<style>
body {
font-family: sans-serif;
display: flex;
@senko
senko / gist:353b182a754704de6783a071391732d6
Created March 5, 2025 09:00
LinkedIn announcement blocker filter
! Add this to your custom filters in uBlock Origin or other blocker extension
||media.licdn.com/media/AAYQA*.gif$image
@senko
senko / slides.html
Created December 6, 2024 09:41
lo-fi slides proof of concept
<!DOCTYPE html>
<html lang="hr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
html,body {
margin: 0; padding: 0; height: 100%; width: 100%;
font-family: sans-serif; background: #fff;
display: flex; align-items: center; justify-content: center;
@senko
senko / clean-transient-folders
Last active November 13, 2023 07:27
Clean ~/Downloads and ~/Pictures/Screenshots on Linux - remove old files and empty directories
#!/bin/bash
#
# Written by Senko Rasic <[email protected]> and released unto Public Domain.
#
# Save this to ~/.local/bin/clean-transient-folders. Then add it to
# your user crontab with a rule like this:
#
# # Run this every day at 5am
# 0 5 * * * /home/<user>/.local/bin/clean-transient-folders
#
@senko
senko / sway-toggle-tabs
Created April 17, 2023 16:57
sway-toggle-tabs
#!/bin/bash
#
# Cycle through all workspaces and set them to tabbed if "small" and
# split horizontally if "big". "Small" is defined as having width less
# than 2880, otherwise it's big.
#
# Looks a bit messy for a split second, but then returns to the current
# workspace.
workspaces_json="$(swaymsg -t get_workspaces)"
@senko
senko / hey-gpt
Created March 29, 2023 17:52
Small bash script to use ChatGPT from command line
#!/bin/bash
if test -z "$1"; then
echo "Usage: $0 <prompt>"
exit 1
fi
if test -z "$OPENAI_API_KEY"; then
echo "OpenAI key is missing - \$OPENAI_API_KEY must be set"
exit 1
@senko
senko / sway-toggle-floating
Created December 22, 2022 16:23
Shell script to toggle window with specified ID as visible/hidden on current workspace, or start the app if it's not running
#!/bin/bash
if test -z "$2"; then
echo "Usage: $0 <app_id> <command ...>"
exit 1
fi
app_id="$1"
shift
@senko
senko / toplang.py
Last active November 3, 2022 21:40
Get the most popular languages on Hacker News
#!/usr/bin/env python
#
# Calculate top list of programming languages based on HN stories/comments/points
# More info: https://blog.senko.net/relative-popularity-of-programming-languages-on-hacker-news
from datetime import datetime, timedelta
from json import dump, load
from os.path import join, exists
from tempfile import gettempdir
from typing import Optional
@senko
senko / keybase.md
Created May 13, 2022 15:31
keybase.md

Keybase proof

I hereby claim:

  • I am senko on github.
  • I am senko_boost (https://keybase.io/senko_boost) on keybase.
  • I have a public key ASAeEgK4it3B4MVJTgPeAhTTI2qYmvtWVXne7x3ZHmHNJgo

To claim this, I am signing this object:

@senko
senko / backup-repo-issues.py
Created July 12, 2019 09:24
Backup GitHub issues from a single repository
#!/usr/bin/env python
#
# Backs up all issues (open and closed) from a specified repository, together with their comments
# Uses GitHub API v3 and requires a valid API token
#
# Installation:
# python3 -m venv /path/to/virtualenv
# source /path/to/virtualenv/bin/activate
# pip install requests