Skip to content

Instantly share code, notes, and snippets.

View Caellian's full-sized avatar

Tin Švagelj Caellian

View GitHub Profile
@Caellian
Caellian / view.css
Created May 22, 2023 13:44
Obsidian dictionary view
.dictionary-view {
display: contents;
}
.dictionary-view * {
box-sizing: border-box;
padding: 0;
margin: 0;
}
.dictionary-view .search-bar {
@Caellian
Caellian / list_project_times.py
Last active April 27, 2023 21:34
ActivityWatch client script that queries VSCode events and shows time spent on projects
#!/usr/bin/env python3
from time import sleep
from datetime import datetime, timedelta, timezone
from dateutil.parser import isoparse
from aw_core.models import Event
from aw_client import ActivityWatchClient
# Server settings
@Caellian
Caellian / grammar.md
Created February 4, 2023 16:11
ChatGPT lowkey good for learning grammar

You

Explain why the following sentence is wrong: "Estoy esperando dar a luz pronto a un bebé"

ChatGPT

The sentence "Estoy esperando dar a luz pronto a un bebé" is grammatically incorrect. The correct sentence would be "Estoy esperando dar a luz pronto a mi bebé" or "Estoy esperando dar a luz a un bebé pronto." In Spanish, it's more natural to say "dar a luz" instead of "tener un bebé."

You

Why? Can you explain those phrases in English?

@Caellian
Caellian / match_os.rs
Last active November 12, 2022 03:10
Rust match target_os macro
/// Match target_os compile time constant.
///
/// Usage:
/// ```
/// match_os! {
/// "windows" => println!("hello from windows"),
/// "linux" | "macos" => {
/// println!("hello from unix")
/// },
@Caellian
Caellian / color.ts
Last active August 18, 2021 05:10
Color Lib
/*
* Copyright © 2021 Tin Švagelj <tin.svagelj@live.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the “Software”), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
@Caellian
Caellian / fix_includes.py
Last active April 29, 2020 17:03
Include Fixer
#!/bin/env python3
import os
import re
import tempfile
import shutil
RootIncludeDir = "/home/asger/Software/Ogre/ogre-next/OgreMain/include" # Root of include directory
TryRelative = ['.', 'Deprecated'] # Alternative lookup paths for includes. Relative to RootIncludeDir
@Caellian
Caellian / update.sh
Last active January 19, 2024 12:51
Emoji list update
#!/bin/env sh
function check_version() {
curl -s "https://unicode.org/Public/cldr/$1/" | grep -o "core.zip<" >/dev/null && echo 0 || echo 1
}
function cldr_versions() {
curl -s "https://unicode.org/Public/cldr/" | grep -oP "(?<=<li><a href=\")\d+(\.\d+)*" | tac
}
@Caellian
Caellian / diff.gradle
Last active October 9, 2019 12:35
Minecraft Project gradle files.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "io.github.java-diff-utils:java-diff-utils:4.0"
}
}
@Caellian
Caellian / vulkanValidificationLayers.cpp
Last active January 28, 2019 01:35
Proper validification layer handling.
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <iostream>
#include <stdexcept>
#include <functional>
#include <cstdlib>
#include <vector>
#include <cstring>
@Caellian
Caellian / manhattan.cpp
Last active December 6, 2018 21:08
MIT - Find which point is furthest from others.
#include <iostream>
#include <map>
#include <vector>
#include <utility>
#include <cmath>
#include <cstdlib>
typedef struct {
int posX, posY;
int name;