Skip to content

Instantly share code, notes, and snippets.

@raed667
raed667 / mastodon-moderation.md
Last active November 29, 2022 19:37
The Big Elephant in the Rooms of Mastodon Moderation

The Big Elephant in the Rooms of Mastodon Moderation

In the recent few weeks, like millions of people, I jumped on the Mastodon bandwagon. After over a decade on Twitter, I was ready for something else. And Musk’s clown-show gave me the push I needed to do a leap of faith.

I wanted to create an account on the biggest, most “official” looking instance (mastodon.social) [14% of total active users], but too many people had the same idea and registration was (and still is) disabled on it.

I sorted instances by number of active users, and the next 3 were mostly for japanese content [collectively 20% of total active users], so I picked the next suitable one (mastodon.online) [2.6% of active users] which is apparently administered by the same people from mastodon.social (I don’t know why they setup 2 s

@raed667
raed667 / Bitwise Operations for the Average Developer.md
Last active October 20, 2022 08:49
Bitwise Operations for the Average Developer

Bitwise Operations for the Average Developer

As a web developer, I haven't thought much about binary and bitwise operations since early school days. I just didn't see a place where shifting or XOR'ing bits would fit in my CRUD apps. That was until I stumbled upon a trick that would save me a lot of headache when dealing with database models.

The following code will be in JavaScript and SQL, but the same concepts will hold in almost any language.

What is binary?

First of all let's see how binary data is written. If you already know how binary works, you can skip to the next section.

Binary Format

@raed667
raed667 / myths.md
Last active August 31, 2022 17:33
Myths Developers Believe About Hiring

1- Experience with the listed frameworks or languages is a must

A good candidate can ramp up quickly. If you can demonstrate solid fundamentals, companies can be flexible over the listed required experience.

2- Technical skills are the only thing that matters

When hiring, we look for someone we can work with. Your interviewer will be evaluating if you’re an overall rounded person and someone they can interact with daily.

Yes, technical skills matter. But often an average team player, will be hired over a technically excellent candidate that can’t work with other people.

@raed667
raed667 / js-framewroks-devs.md
Last active July 3, 2022 10:30
Why Developers Hate New JavaScript Frameworks?

It feels like everyday a new JavaScript framework is born. It promises to be “blazing” fast and better than anything that came before it (obviously).

You check the landing page, you star the Github repo “just in case” and you move on with your life.

Or maybe you don’t, maybe you feel offended to the bone that this new generation of developers is just running in circles, reinventing what PHP or JSP were able to do 15 years ago. You go on HackerNews and rant about framework-of-the-day and how everyone is wasting your time.

Why do people react like this when someone just shares with them usually free work. Work that took months of their lives. The authors probably spent days and days not only writing the code, but also picking a name, a logo, making a landing page, writing documentation. But then instead of the expected support and excitement, they are faced with rejection or even rage.

How dare you make me learn something new, when the old thing was perfectly decent?

@raed667
raed667 / recruiters_developers.md
Last active May 5, 2022 15:31
Dear recruiters, here is why developers don’t respond to your messages

Dear recruiters, here is why developers don’t respond to your messages

All developers are familiar with the typical unsolicited recruiter messages. They are generic, usually feel spammy and it gives recruiters a bad reputation.

These messages usually go something like this:

Hey ${first_name},
I find your profile very interesting and I think you’re a great match for a role I’m recruiting for.
Let's schedule a call so I can tell you more about it.
@raed667
raed667 / game-of-life.js
Last active April 12, 2020 10:56
Very basic JS implementation of Conway's Game of Life
let Matrix = [];
const fillMatrix = (m, size) => {
for (let index = 0; index < size; index++) {
m[index] = Array(size).fill(false);
}
};
const getCellSafe = (i, j) => {
if (Matrix[i] && Matrix[i][j]) return Matrix[i][j];
@raed667
raed667 / checkstyle.js
Created March 8, 2019 08:09
Small utility that merges 'checkstyle' files into one
var fs = require("fs");
var xml2js = require("xml2js");
var argv = require("yargs")
.alias("d", "dir")
.alias("o", "out").argv;
var INPUT_DIRECTORY = "./";
var OUTPUT_FILE = INPUT_DIRECTORY + "merged/checkstyle.xml";
@raed667
raed667 / download.js
Last active September 14, 2020 12:44
Download a file using axios (works with Chrome, FireFox, Safari, Edge, IE)
import axios from "axios";
export const download = async (uuid) => {
const { data } = await axios({
url: `/api/download/${uuid}`,
method: "GET",
responseType: "blob",
});
const blob = new Blob([data], {
type: "application/pdf",
@raed667
raed667 / nice-sophia.json
Created September 24, 2018 11:48
230 bus line stops
[
{
"paths": ["nord"],
"name": "Fontaine Du Temple",
"coordinates": { "latitude": "43.726072", "longitude": "7.255815" },
"stopId": "1914",
"isPickup": true
},
{
"paths": ["nord"],
<template>
<item v-for='item in hn.topStories' :key='item.id' :item='item'>
</item>
</template>
<style>
// ...
</style>
<script>