Skip to main content

Posts

Git as Messages Queue

Hey, Good idea bad pitch, lets use Git as a messaging queue! lets use github to synchronize a cluster of them together. Lets get the obvious out of the way, You already know we use Git to keep track of our code changes, and we need a central point to pull and push these changes, this is why we use github/lab/bitbucket…etc. Alright, now lets introduce another idea: Git commits doesn’t need to include changes, so you don’t need to have to create files then commit these files to your git repo, you can create an empty commit with a command like this
Recent posts

Tracing Ruby Applications Execution in 4 Lines

I was researching a simple way to trace ruby code, so the problem I tried to solve (as usual) is to understand the code infront of me even more, so I need some monitor, when I open a rails server and I navigate around, I need to see the methods executed and where is it located, I need to see that in realtime. Turns out the solution is very simple, as Ruby has TracePoint module, you can use it to log any thing gets called in your application, so adding this snippet to your rails initializers or anywhere before your application starts.

Representing Named Entity Mention in Postgres for Fast Queries

For the past 3 years I have been working on a side project called https://ift.tt/2QPUP8t, it’s specialized in collecting news and analyzing it to find public figures mentions and build analytics on it, in that article I’ll walk through the evolution of representing the relation between the entities (people figures) and the news (tweets, fb posts, YouTube videos and rss articles). Technology stack I’m a backend developer so most of the solution is heavy on the backend and lighter on the frontend, but as we’ll talk now about the “mentions” implementation I’ll talk only about the backend part, the tools I used were:

Cloning All Your GitHub Repositories or Updating Them in One Command

I had a new laptop couple weeks ago at work, and I had to set it up with everything I need including the projects I have been working on from GitHub, I remembered how I usually git clone every project I start working on, it involves going to GitHub to the project page, copy the clone URL then go to my terminal, change directory to my projects directory then execute git clone http://github.

Async Rendering a Page With Sinatra

I was thinking, what if you need a server that serves a page that does alot of processing, it sends multiple commands, does alot of queries and most of them takes a long time. Waiting for all commands to finish isn’t an option, fast response time is also a requirement, so a solution could be warming up a cache then render the page from this cache. That solution means you will also wait for all commands/queries to finish then respond with your output.

مراجعة رواية The Gods Themselves

امبارح خلصت رواية The gods themselves أو “الألهة ذاتهم” لإيزاك ازيموف، روايات قليلة اللى بعدها بحس بالإحساس اللى حسيته بعد ماخلصت الرواية دي، احساس ان فيه حاجة جديدة عرفتها، او نوع جديد من الخيال ماكنتش متصور انه موجود واكتشفت انه ممكن فجأة. علشان الرواية دي بالإنجليزي وتقريبا مش مترجمة للعربي هحاول الخصها بسرعة لأن فيه أفكار حلوة جدا خصوصا الجزء التاني منها. الرواية بتسرد فترة فاصلة فى حياة البشر على الأرض بدأت بعالم فى الكيمياء الاشعاعية اسمه “هالام” علي مكتبه عينة من التنجستين-186 كانت هنا من فترة طويلة تقريبا العالم اللى كان بيشغل المكتب ده قبله طلبها ما استخدمهاش، فى يوم من الايام لقي ان العينة شكلها متغير، غضب جدا لدرجة انه افتكر ان واحد من زملاؤه اللى بيكرهوه ممكن يكون تلاعب بيها، سأل العالم “دنيسون” عنها فقاله انه ماغيرهاش، وبعدين “ايش عرفك يعني انها مش تنجستين؟” ف”هالام” راح كنوع من ال”هوريك يا حمار انت انني بفهم وده مش تنجستين-186” وداها تتحلل فى معمل.