Skip to content

Instantly share code, notes, and snippets.

View ahmedmahmoudit's full-sized avatar

Ahmed Shalaby ahmedmahmoudit

View GitHub Profile
@ahmedmahmoudit
ahmedmahmoudit / dev_questions2G233.md
Last active February 2, 2021 13:27
Drupal Developer Questions

Drupal Developer Questions

Question 1

A client has called and said that they're noticing performance problems on their database when searching for a user by email address. You've checked, and the following query is running:

SELECT * FROM users WHERE email = 'user@test.com';

You run the EXPLAIN command and get the following results:

@ahmedmahmoudit
ahmedmahmoudit / 0_reuse_code.js
Created May 20, 2014 23:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ahmedmahmoudit
ahmedmahmoudit / read_exif
Last active December 20, 2015 13:09
Remove camera orientation/angle of the apparatus by reading the EXIF information out of the JPEG file
function remove_orientation($full_filename)
{
$exif = exif_read_data($full_filename);
if($exif && isset($exif['Orientation'])) {
$orientation = $exif['Orientation'];
if($orientation != 1){
$img = imagecreatefromjpeg($full_filename);
$mirror = false;
$deg = 0;