Friedrich Ewald My Personal Website

Recent Posts


  • ChatGPT

    Who are you?

    I am Assistant, a large language model trained by OpenAI to assist with a variety of tasks. I am not a person, but rather a program that uses advanced machine learning algorithms to process and generate text. I am here to provide information and help answer your questions to the best of my ability. Do you have any questions I can help you with?
    Do you have any special skills?
    As a language model, my primary skill is generating and understanding natural language text. I am trained to assist with a variety of tasks, including answering questions, providing information, and engaging in conversation. I am constantly learning and improving my abilities through machine learning, so my capabilities are always expanding. Is there something specific you would like to know or discuss? I would be happy to help with any question or topic you have in mind.
    When being asked about ChatGPT, it doesn’t know itself. Likely because it was trained on data ending in 2021 which is before ChatGPT was published. I recommend trying it out.

    Update Jan 25 2023

    Since a few days, ChatGPT has a premium plan. Anecdotaelly, I just went there and I got a message “ChatGPT is at capacity right now”. It seems like the free days are over.

  • Testing email sending

    I recently came across MailHog. I needed to test some email functionality locally. MailHog creates an SMTP that accepts any email to any address and shows this in web interface.

  • Heroku Price increase

    Heroku will increase prices and remove many free tiers.

  • Change font size depending on post length

    One of the things that I like about Twitter is that the font size changes depending on the length of the tweet. Yesterday, I tried to achieve the same thing for this Jekyll based blog and came up with the following solution. First, I created a plugin (in the folder _plugins) and registered it as Liquid filter with the following code:

    module Jekyll
      module PostFilter
        def post_class(input)
          # Catch invalid posts
          return 'default' if input.nil?
          
          if input.size < 32
            return 'large'
          elsif input.size < 64
            return 'medium'
          else
            return 'default'
          end
        end
      end
    end
    
    Liquid::Template.register_filter(Jekyll::PostFilter)
    As a next step I changed the post.html template to this:
    <p itemprop="articleBody" class="{{content | post_class }}">
      {{ content | remove: "<p>" | remove: "</p>" }}
    </p>
    It is important to remove the <p> tags because they cannot be nested in valid HTML and Jekyll adds their own tags to post content. Finally, I created some SCSS to change the font-size based on the CSS class.
    /* Post pages */
    div.post {
        p.default {
            font-size: 1em;
        }
        p.medium {
            font-size: 1.6em;
        }
        p.large {
            font-size: 1.8em;
        }
    }

  • Leetcode: House robber II

    Similar to “House Robber”, but now we have to assume that the houses are aligned in a circle and the last house is a neighbor of the first house.

    Continue reading

Page: 7 of 33