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
@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 / 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 / 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 / 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 / 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.
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
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