YeenDeer softness blog (programming and electronics)

Ellie the Yeen is a soft YeenDeer that mweeoops and does programming

View on GitHub About Bots Projects Tags

The YeenDeer softness blog

Hi this is the blog of a YeenDeer mostly about programming and similar topics
  • Mastodon comment section on GitHub pages

    So you want a comment section on your blog on Jekyll but as it is static you cannot do any server side processing at all and you have to rely on Disqus or a similar service. Another thing you can do it make your own comment section using Mastodon since it tends to have a very open API with Access-Control-Allow-Origin: * which means that JavaScript in a browser can access the data. This is something that has been done by quite a few like here and here so it is not an entirely new concept but it is a useful one.

  • Useful command line aliases

    There are quite a bit of useful aliases you can have on your command line in order to do many useful things. Having aliases makes using the shell much easier and if you have any command that is hard to remember or write I really recommend to add it to aliases since then you will have a way easier command line experience. Here are some of the aliases I use on my command line that gets sourced in ~/.bashrc and ~/.zshrc

  • Compact exception printing in Python

    So recently I had the problem of something throwing exceptions and it was like really long exceptions that went way over 4 kilobytes of text which was hard to find something useful inside. So what was needed is something that made the exceptions much easier to see and to know the messages and the type rather than the 20+ files the stacktrace went through. At first this was a tough problem that maybe the stacktrace maybe had a solution to until the following was discovered. Apparently Python exceptions have two different attributes called __cause__ and __context__. What they do is they tell you what the previous exception was but they are slightly different. __cause__ is only set if there was something like

    raise ValueError("Something wrong") from e
    

    while __context__ is always set as long as a previous exception is there and otherwise it will be None.

  • GitHub profile and other special repositories

    GitHub has 3 special repositories each user or organization can have which does special things if created. The 3 of these are username that should have the same name as your username, .github and username.github.io where username should be your username in lowercase. These have various useful features that are very useful if you use GitHub a lot.

  • Add your own search engine in your browser

    Have you ever seen that you are able to second click on the address bar on website and wondered why there is a menu to add something? What you will be adding if you press yes is that you are able to have a search engine that pops up in the address bar if you click on it. When you have several search engines added you can hold alt and press the up and down keys to switch what search engine you want to use for the current search. What is also good to know is that you can write something short called a keyword then press space or sometimes tab and it will select that search engine and then you can enter your term and search with it.

  • Making a sitemap XML in Liquid

    Decided to make a simple sitemap generator using Liquid that is a part of jekyll. it is a template language that lets you do quite a few things like you can generate quite a few different data formats using it and it supports iterations and variables and such.

  • Posting on Mastodon with GitHub Actions

    So you might wonder if GitHub Actions can be used to make posts on Mastodon for simple bots such as to do stuff like maybe you want a Mastodon comment section or something like that and do not want to manually have to add the ids or store them externally.

  • The mysteries of the web root

    There are many files in the web root folder that is used for many different things that are often automatically grabbed by either bots or your browser. Here is a list of various things I have used and read about.

  • Open graph tags for SEO and social media optimization

    Have you ever seen links posted on social media where you get a preview of the content of the website that you link and wonder how that is made. It is done using certain HTML tags that a bot fetches when you link the webpage. This is of course subject to the robots.txt in the web root as most bots tend to follow that when fetching content. Below is an example of how that can look like.

  • Adding comments and upvotes to your blog using Disqus

    So you have a website and you are using a static website generator like jekyll or you do not want to make your own comment section due to the security issues it can cause. What you can do then is use a service like disqus in order to present a comment section inside an iframe. This is one among other solutions to provide a comment section for your blog. There are of course also other ways like Facebook has a thing where you can add a comment section using it. There are also some fancy unusual solutions like using a certain Mastodon post as a comment section which I read about when I searched for another post about how to make a Mastodon share button and both of these posts are extremely interesting and I recommend reading them.

  • Python sched module and rescheduling

    Lets say you have some code that is waiting for a state to settle and you want to be able to make sure it really settles before trying to do anything with it. Or maybe you want to make a simple Watchdog timer or Dead man’s switch mechanism. You can look at the Python built in module sched.

  • Making Python EXE files on Windows

    So sometimes you have certain Windows programs that do not really want to take many arguments and want just a single exe file to point at. A good example of this is protocol handlers or just general command line programs for when you do not use tools like cygwin currently.

  • Previewing of 3D models on GitHub

    Was trying to figure out how to actually preview 3D models on GitHub and found out a few things.

  • How to create a blog with Jekyll and GitHub Pages

    GitHub pages is a free and quite easy way to set up a free website. It comes with many fun features like many themes you can install. What it supports is jekyll which allows you to automatically have GitHub build the HTML files for you using markdown. There are also many plugins such as Jekyll-Feed that create a RSS XML file for you

  • Making a simple RSS to Mastodon poster powered by GitHub hooks

    Decided to make a simple RSS to Mastodon poster powered by GitHub hooks.

  • Setting up a blog

    This is my blog what I am going to post posts that are too long for my Mastodon but also to be able to have a better archive of posts and better text formatting.

    The posts will mostly be technical things about projects and I am going to make some tools to make it easier to post.

    It will be fun to make some tools such as one to make posts here automatically go to social medias and also one to make posting of images easier. I will ofc publish those tools as soon as I make them. There are for example probably some tools to make previews more detailed on social media.

    Later I might create a second blog for my art or something like that if I decide to continue with it but there are quite some art projects I want to do.

    There are still some quirks to work out like how to make it easier to post certain things especially pictures as EXIF data needs to be stripped and such. There is a plugin for jekyll called jekyll-feed so you can subscribe to this blog with RSS.

  • 2
  • 3