Skip to content

Instantly share code, notes, and snippets.

Avatar
📱
Learning and developing

Ahmed Helal AhmedHelalAhmed

📱
Learning and developing
View GitHub Profile
View ubuntu16.04-command-line-install-android-sdk
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
View centos7 update git
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 Jul 11, 2018 — forked from subfuzion/http-status-codes.md
General REST API HTTP Status Codes
View http-status-codes.md

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 Jul 14, 2018 — forked from amaelftah/conditional-function.php
extracting conditions to meaningful functions
View conditional-function.php
<?php
if (
$employee['age'] < '40'
&& $employee['medical_health'] == 'healthy'
&& $employee ['work_happits'] != 'bad'
)
{
// do somethings
@AhmedHelalAhmed
AhmedHelalAhmed / ExamplePassportTest.php
Created Aug 5, 2018 — forked from archy-bold/ExamplePassportTest.php
Testing Passport Authenticated Controllers and Routes in Laravel
View ExamplePassportTest.php
<?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 Aug 6, 2018 — forked from JeffreyWay/PhotoApiTest.php
Testing APIs in Laravel. Thoughts?
View PhotoApiTest.php
<?php
class PhotoApiTest extends TestCase {
public function setUp()
{
parent::setUp();
Route::enableFilters();
@AhmedHelalAhmed
AhmedHelalAhmed / gist:d8661d1f135b2957be1744388342f2ee
Created Aug 6, 2018 — forked from damir-bubanovic/gist:d67d54b2c19aa233f51f63b3d9f0f4be
Laravel 5 - create fake data with $faker & populate database
View gist:d8661d1f135b2957be1744388342f2ee
<?php
/**
* SEEDING DATABASE
*
* Faker Fileds:
* https://github.com/fzaninotto/Faker
*
* 1) Create database, model, migration
* 2) artisan make:seeder
@AhmedHelalAhmed
AhmedHelalAhmed / git.migrate
Created Aug 10, 2018 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
View git.migrate
#!/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 Sep 4, 2018 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
View get_gists.py
# 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 Sep 6, 2018 — 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
View _ide_helper.php
<?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");