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
@damir-bubanovic
damir-bubanovic / gist:d67d54b2c19aa233f51f63b3d9f0f4be
Last active August 6, 2018 16:44
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
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
@robertzibert
robertzibert / .env
Last active June 13, 2019 06:46
Ubuntu Laravel and Lumen Installation
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomKey!!!
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
@zaratedev
zaratedev / .php_cs
Created December 6, 2019 01:56
The config .php_cs example
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => array('syntax' => 'short'),
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
'single_quote' => true,
@ddeveloperr
ddeveloperr / shutdown_timer.md
Last active July 2, 2021 02:01
How to shutdown timer using Terminal/cmd on windows 10 and Linux & Mac OSX

Initial Steps

*1) Press Windows Key + R. *2) Enter CMD and press Enter.

Execute it

Write command in the cmd:

shutdown /s /t 3600
@JeffreyWay
JeffreyWay / PhotoApiTest.php
Created May 21, 2013 22:37
Testing APIs in Laravel. Thoughts?
<?php
class PhotoApiTest extends TestCase {
public function setUp()
{
parent::setUp();
Route::enableFilters();
Simple contract or interface, call as you wish:
interface UnitOfWork
{
public function begin();
public function commit();
public function rollback();
}
@garciasdos
garciasdos / Dockerfile
Last active August 17, 2022 20:28
Symfony 5.0 && PHP 7.4 minimal installation
FROM php:7.4-fpm-alpine
WORKDIR /var/www/app
RUN apk add bash
# intl
RUN apk add --quiet zlib-dev icu-dev g++
RUN docker-php-ext-install intl && docker-php-ext-enable intl
@webarthur
webarthur / get_youtube_channel_ID.php
Created April 11, 2016 21:46
Get youtube Channel ID by channel url
<?php
function get_youtube_channel_ID($url){
$html = file_get_contents($url);
preg_match("'<meta itemprop=\"channelId\" content=\"(.*?)\"'si", $html, $match);
if($match && $match[1]);
return $match[1];
}
@archy-bold
archy-bold / ExamplePassportTest.php
Last active October 15, 2022 03:49
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;