YeenDeer softness blog

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
  • Throwing away jekyll-seo-tag

    So recently there was a problem on Bing webmasters where it complained that the site has too long description meta tags. The reason for this is that Jekyll takes the description from the site.excerpt variable which is something that can be very long and sometimes almost a thousand characters in some circumstances. There were 2 alternatives to solve this. One is to rewrite every single post to have a specific description that does not exceed the specifications or we can create our own meta tags and the latter is what we are going to do.

  • Making tables in Liquid from Jekyll front matter YAML

    Did you know that you can generate tables from data in Liquid so you do not have to deal with the format that markdown uses for tables? Here is how you can do that.

  • Mastodon RSS latest posts website feed

    Do you remember when almost every website had an embedded Twitter feed so you could see the Tweets of the owner of the website? What if I told you that you could achieve the same using the RSS feed from a Mastodon server as it has Access-Control-Allow-Origin: * set. What this means is that clients in the browser are able to make requests towards a website without being blocked by the cross origin policy.

  • Sleep tracker with smart home lamp control

    So I recently decided to fix up my command line sleep tracker since it is a thing I have wanted to fix for a while. The specific issue is that I specifically have to find the enter key to press when I wake up to turn on the lights. The whole tracker works that you run it and all the lamps turn off then it waits for a key press and when a key is pressed it turns the lamps on again and tell how long time you slept for.

  • Making a tags page without using jekyll-archives

    There is an extension for Jekyll called jekyll-archive which allows you do make extra pages without creating the files for them such as category pages, tag pages and ones for specific dates and such. This is really good however there is one downside, it does not work on GitHub pages.

  • What is a file manager?

    Do you know what a file manager is? it is very likely that you do not as it is a thing that is very taken for granted due to them coming preinstalled on almost every system. Nothing (usually) stops you from installing another one if there is one you like better. The main point is what a file manager actually does. It is a program that allows you to browse, copy, move, delete, create and see information about files using some form of interface. It also is used to launch files or launch editors in order to edit files and often also allows you to preview them or at least launch a program that previews them.

  • RSS feed using Liquid

    Even if jekyll-feed is something you do have if you have a GitHub pages site there are many cases where you do want to be able to make your own RSS feeds. Such cases can be that you have very different categories that would not make sense to have the same feed for or you are using another templating engine such as Jinja which has an almost identical syntax or maybe even PHP and want to know the gist of how you would make a feed there. We are only however focusing on Liquid specifically in this article.

  • Generating share buttons using Liquid

    Liquid is a powerful templating language even if it is a non evaluating one. In the past we made some Share buttons using all the data we had gathered from various websites about how they use URLs for their share dialogs. What we can do with this data is generate share buttons in a fancy and easy way using Liquid.

  • Dynamic favicons

    Did you know that favicons on websites can be dynamic? You probably do since they are everywhere to display notifications on social media sites. We are going to look at how that is done and then implement it ourselves. At first we are going to look at a practical example of how it can look like.

  • Browser extensions and userscripts

    It is very easy to make browser addons for Chrome and Firefox. It has a simple and concise JavaScript API that is almost identical between them. You can always look at the API reference for Chrome and Firefox if you have no idea what to do.

  • Git for absolute beginners

    Git is a version control system that allows you to have files stored in specific versions then compared, updated or restored and various operations related to the history of the file and any changes. This is what a version control system does. You can have multiple branches too which is different versions of the files which is good for when multiple users work on something that then gets merged into the main branch.

  • Share dialogs and buttons

    On many websites there are buttons to share an article to other sites or to chat services. This is done in the browser either by linking to the website and passing parameters about the post to share or a protocol handler might be used when there is an actual application installed. In the case of email for mailto links it is really any mail that has it registered. We are going to look at different sites dialogs and how the link is constructed.

  • Automatic Git commit templates generator

    Git has a feature where you are able to set a template message for every commit you do by specifying a file either in config or as a command line argument. This might not seem as useful on its own as it is a static message that appears every single time as a base for your commit message and does not allow any variables. There is however a thing you can do in order to change that.

  • Making a Discord systemd failure handler

    Did you know that systemd allows you to create special units that run only when other units fail and that they can be used to send notifications when services go down. Now we are going to look at how that would be done using Discord using Webhooks. In the screenshot below is an example of a message generated using this method that uses a Discord embed with a custom profile picture.

  • OpenGraph and oEmbed. Who? What? Why? When? Where?

    So when you paste a link into a social media site or a chat app a certain thing tends to happen. The app sends a bot to the site in order to look at it and see what it is and if it is a picture maybe they will display it too you and the others in chat and if it is a HTML page it will find some meta tags and similar data in order to give you a preview in chat for everyone to view.

  • How to subscribe to all GitHub events through WebHooks

    So you might have noticed that on every repository on your GitHub you are able to put a webhook url that gets called whenever an event happens. To put a webhook on every project and then put on every new project can be an annoyance and what if I told you there is a way to subscribe to every single repository event on your GitHub projects?

  • 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 where username should be your username in lowercase. These have various useful features that are very useful if you use GitHub a lot.

  • 1
  • 2