Skip to content

Instantly share code, notes, and snippets.

View zymawy's full-sized avatar
🐛
Debugging

Hamza Ironside zymawy

🐛
Debugging
View GitHub Profile
@zymawy
zymawy / youtube_id_regex.php
Created January 17, 2019 18:50 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ

We can see we have php 7.0 available out of the box:

sudo apt-cache show php-cli

Instead of using that, we'll start by installing the latest PHP 7.1, via the populate PHP repository.

```php
Route::get('put', function() {
$member = App\Member::with([
'relatives',
'desires',
'skills',
'experiences',
'user'
])->find(3)->toArray();
$memberNames = explode(" ", $member['full_name']);
@zymawy
zymawy / twitter-verified-icon.svg
Created November 30, 2018 16:52 — forked from notslang/twitter-verified-icon.svg
The blue verified icon, extracted from Twitter's icon font & resized using Inkscape
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zymawy
zymawy / addUserToSever.md
Last active November 29, 2018 10:22
Create a User On The Server

Let's create a new user and then setup some security.

  • New User
# login first
sudo adduser zymawy
# Create password
# Skip extra field
# Set Y to save the new user
@zymawy
zymawy / UsersIndex.vue
Created November 24, 2018 09:14 — forked from paulredmond/UsersIndex.vue
UsersIndex component for use with vue-router - https://laravel-news.com/building-vue-spa-laravel-part-3
<template>
<div class="users">
<div v-if="error" class="error">
<p>{{ error }}</p>
</div>
<ul v-if="users">
<li v-for="{ id, name, email } in users">
<strong>Name:</strong> {{ name }},
<strong>Email:</strong> {{ email }}
@zymawy
zymawy / allTheSchoolNamesOnMakkehRegion.json
Last active September 12, 2018 02:46
جميع اسماء مدارس منطقة مكة المكرمة
Array[6329][
{
"Id": 2,
"ArabicName": "معهد الحرم المكي الشريف - بنين",
"EnglishName": "معهد الحرم المكي الشريف - بنين",
"SchoolCode": "00001",
"RegionName": "مكة المكرمة",
"CityName": "مكة المكرمة"
},
{
'<option value="هندسة مدنية" title="">هندسة مدنية</option>' +
'<option value="هندسة معمارية" title="">هندسة معمارية</option>' +
'<option value="هندسة ميكانيكية" title="">هندسة ميكانيكية</option>' +
'<option value="هندسة كهربائية" title="">هندسة كهربائية</option>' +
'<option value="هندسة إلكترونية" title="">هندسة إلكترونية</option>' +
'<option value="هندسة اتصالات" title="">هندسة اتصالات</option>' +
'<option value=" تخطيط المدن والأقاليم" title=""> تخطيط المدن والأقاليم.</option>' +
'<option value="هندسة المعادن" title="">هندسة المعادن</option>' +
'<option value="هندسة الوقاية من الإشعاع" title="">هندسة الوقاية من الإشعاع</option>' +
'<option value="هندسة نووية" title="">هندسة نووية</option>' +
@zymawy
zymawy / ForgotPasswordController.php
Created June 18, 2018 11:37 — forked from nasrulhazim/ForgotPasswordController.php
Reset and Update Password from API
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Transformers\Json;
use App\User;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\Request;
@zymawy
zymawy / web.php
Last active April 7, 2018 13:53
Listen for illuminate queries
// routes web.php
\Event::listen('illuminate.query', function($sql) {
var_dump($sql);
\Log::info($sql);
});