I created a Browser extension that Enables Youtube Comments when they are disabled!

About a week ago, I wrote a blog post about how I concluded that disabling comments on Youtube videos could be oppression of free speech.

My philosophy is that if you have the freedom and opportunity to express your opinions to the public, you should be open to receiving criticism and feedback. Preventing people from expressing their thoughts on that by using features like disabling commenting, is against freedom of speech.

This incident became a reason that I made Kament, a commenting platform for Youtube shipped as a browser extension that is enabling comments on videos when the commenting section is restricted. a tool to empower the public to express their voice, not affiliated with Youtube, or the publisher of the video, completely neutral, made to bring Free Speech back to Youtube.

Kament is currently available on Google Chrome Store and Firefox Addons Store, which essentially makes it available for all chromium-based browsers such as Opera, Microsoft Edge, Brave, and Vivaldi.

Once you install the extension, you need to sign in with your Google account, and that’s it, whenever you open a video in which the comments are disabled, Kament.io will activate and allow you to post comments. You no longer need to take such discussions to platforms such as Reddit or Twitter, you can comment on the video, right there.

To get started and be up and running with Kament in less than 20 seconds, check https://kament.io .

If you support this idea, it would be great if you share it with your friends and follow our social media accounts on Twitter and Instagram.

Also, I would be more than happy to hear your comments and suggestions on this!

Disabling Youtube Comments is an Oppression of Free Speech

I am not really someone who engages himself in controversial discussions, debates, and internet battles, and I don’t think I’ll ever be. But this has never meant that I do not have an opinion about issues that are being discussed daily in public and on the internet.

A while back, I stumbled upon a Youtube video, an interview with someone whose beliefs and ideology about a subject was the opposite of the interviewer. The whole theme of the video was to attack the person in the interview. I listened to it thoroughly, with no bias toward the person being attacked. I rarely post Youtube comments, but this time it felt like I should give my opinion about the content and the issue that was being discussed.

Continue reading “Disabling Youtube Comments is an Oppression of Free Speech”

Remove large file from a git commit

I’ve done it again, super excited to work on my new pet project, I ran dd command to test my new VPS I/O Speed and created a 1-gigabyte file in my repository folder, and somehow I accidentally committed that.

Unless you’re using a self-hosted git server with a large max upload, you’ll probably get an error trying to push your changes with this large file, since this file will be in git history for restoration purposes, simply removing it from the repository and doing another commit does not work.

To resolve this issue you can use git filter-branch as below:

git filter-branch --force --index-filter \
  'git rm --cached --ignore-unmatch path/to/bigfile.data' \
  --prune-empty --tag-name-filter cat -- --all

Replace the path with the location of the big file, you can then push your changes to your remote branch.

First Surgery in Germany

Around 5 years ago when I was still in Malaysia, I was at a company event at A’Famosa Resort in Malacca. The whole company and their families were invited to spend the weekend together, and enjoy the nice Malacca food, while our days were full of activities and games. one of those games that we played once was the infamous tug of war. I don’t even remember when was the last time I played that game as a child, anyhow even the most boring games could be fun when you’re playing them with friends and colleagues. but apparently, my long-trained programmer’s body was not strong enough to cope with me pulling a rope as hard as I could just to make my team win.

Continue reading “First Surgery in Germany”

Parsing ndjson stream API’s with PHP

Readable Streams are API responses that are broken into small chunks and sent to the client. As the client should be able to parse the chunks of received data as they arrive the conventional JSON responses are not ideal to be used for streams.

So In most cases, streamable API endpoints should send the data line by line. ndjson is a good option for sending JSON structured data in a streamable way. if you have not heard about ndjson before, it stands for new line delimited json.

First thing first we should call the API via Guzzle, by default guzzle uses PSR-7 stream object to represent the responses.

Here is a sample call to a streaming API that returns a stream response object:

<?php
$stream = $guzzleClient->get("http://stream-api.com/api",
    [
        'stream' => true,
    ]
)->getBody();

Now that we have stored the stream object in $stream variable we can use the “eof” method to verify we have not reached the end of the streamed data. by utilizing the helper readline we will read the output line by line. which should give us a single JSON object.

while (! $stream->eof()) {
  $line = Utils::readLine($stream);    
}

as simple as that we can read chunked received data from a streaming API with php.