Skip to content

Instantly share code, notes, and snippets.

View AhmedHelalAhmed's full-sized avatar
📱
Learning and developing

Ahmed Helal AhmedHelalAhmed

📱
Learning and developing
View GitHub Profile
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jre
# install openjdk
sudo apt-get install openjdk-8-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
reference: http://stackoverflow.com/questions/21820715/how-to-install-latest-version-of-git-on-centos-6-x-7-x
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
yum update git
@AhmedHelalAhmed
AhmedHelalAhmed / http-status-codes.md
Created July 11, 2018 15:08 — forked from subfuzion/http-status-codes.md
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.
@AhmedHelalAhmed
AhmedHelalAhmed / conditional-function.php
Created July 14, 2018 11:49 — forked from amaelftah/conditional-function.php
extracting conditions to meaningful functions
<?php
if (
$employee['age'] < '40'
&& $employee['medical_health'] == 'healthy'
&& $employee ['work_happits'] != 'bad'
)
{
// do somethings
@AhmedHelalAhmed
AhmedHelalAhmed / ExamplePassportTest.php
Created August 5, 2018 11:23 — forked from archy-bold/ExamplePassportTest.php
Testing Passport Authenticated Controllers and Routes in Laravel
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExamplePassportTest extends \PassportTestCase
{
use DatabaseTransactions;
@AhmedHelalAhmed
AhmedHelalAhmed / PhotoApiTest.php
Created August 6, 2018 11:46 — forked from JeffreyWay/PhotoApiTest.php
Testing APIs in Laravel. Thoughts?
<?php
class PhotoApiTest extends TestCase {
public function setUp()
{
parent::setUp();
Route::enableFilters();
@AhmedHelalAhmed
AhmedHelalAhmed / gist:d8661d1f135b2957be1744388342f2ee
Created August 6, 2018 16:44 — forked from damir-bubanovic/gist:d67d54b2c19aa233f51f63b3d9f0f4be
Laravel 5 - create fake data with $faker & populate database
<?php
/**
* SEEDING DATABASE
*
* Faker Fileds:
* https://github.com/fzaninotto/Faker
*
* 1) Create database, model, migration
* 2) artisan make:seeder
@AhmedHelalAhmed
AhmedHelalAhmed / git.migrate
Created August 10, 2018 19:06 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@AhmedHelalAhmed
AhmedHelalAhmed / get_gists.py
Created September 4, 2018 21:20 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
@AhmedHelalAhmed
AhmedHelalAhmed / _ide_helper.php
Created September 6, 2018 15:36 — forked from barryvdh/_ide_helper.php
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");