Skip to content

Instantly share code, notes, and snippets.

View islammohamed's full-sized avatar

Islam Abdelaziz islammohamed

  • WorkMotion, ex: OTTO Group
  • Berlin, Germany
View GitHub Profile
@islammohamed
islammohamed / LineString length in KM
Created June 13, 2020 10:39 — forked from mpuig/LineString length in KM
How to calculate the (real) distance of a linestring object, in km (or any other distance unit)
from django.contrib.gis.geos import Point
from django.contrib.gis.geos import LineString
from models import Track
# [...]
points = []
for lat,lon in coords:
pnt = Point(float(lon), float(lat))
points.append(pnt)
@islammohamed
islammohamed / ddd.md
Created August 12, 2019 21:45 — forked from zsup/ddd.md
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
@islammohamed
islammohamed / tech-lead.txt
Created August 2, 2019 08:53
Books on technical leadership
http://www.amazon.com/Leading-Geeks-Manage-Deliver-Technology/dp/0787961485
http://www.amazon.com/The-Geek-Leaders-Handbook-Backgrounds/dp/0971246823
http://www.amazon.com/Technical-Minds-Leading-Getting-Technically-Minded/dp/145158315X
http://www.amazon.com/Frustration-Free-Technical-Management-Techniques/dp/1609100352
http://www.amazon.com/Managing-Humans-Humorous-Software-Engineering/dp/159059844X
http://www.amazon.com/Becoming-Technical-Leader-Problem-Solving-Approach/dp/0932633021
http://www.amazon.fr/Talking-Tech-Leads-Novices-Practitioners/dp/150581748X
https://www.amazon.com/Chief-Technology-Officer-Responsibilities-Technical/dp/0982304048
https://www.amazon.com/CTOs-at-Work-Scott-Donaldson/dp/1430235934
@islammohamed
islammohamed / braking.md
Created November 8, 2018 21:37
Fahrschule
@islammohamed
islammohamed / celery.sh
Created September 26, 2018 15:59 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@islammohamed
islammohamed / intro.txt
Created April 25, 2017 14:40 — forked from primaryobjects/intro.txt
The Parking Lot Problem: A Google Interview Question for Software Engineers.
This question was found at https://www.careercup.com/question?id=5750868554022912
Suppose a row of parking lot with n spots, one of them is empty and n-1 spots are occupied with cars.
Only one operation is allowed: move one car from its position to the empty spot.
Given a initial order of cars and a final order, output steps needed to convert initial order to final oder with that operation.
Solution
========
This type of planning problem can be solved using the AI planning algorithm STRIPS.
@islammohamed
islammohamed / stdc++.h
Created April 25, 2017 13:26 — forked from velicast/stdc++.h
Linux GCC 4.8.0 /bits/stdc++.h header definition.
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
<?php
/*
(2014) Main source -> http://lancenewman.me/posting-a-photo-to-instagram-without-a-phone/
I just managed to sniff Instagram traffic and fixed the code
-- Have fun - batuhan.org - Batuhan Katırcı
--- for your questions, comment @ http://batuhan.org/instagram-photo-upload-with-php/
@islammohamed
islammohamed / mount-ram.sh
Created May 12, 2016 07:52 — forked from koshigoe/mount-ram.sh
Like tmpfs in Mac OSX
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#
@islammohamed
islammohamed / The Technical Interview Cheat Sheet.md
Created April 28, 2016 22:16 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.