Skip to content

Instantly share code, notes, and snippets.

View ziishaned's full-sized avatar
:octocat:

Zeeshan Ahmad ziishaned

:octocat:
View GitHub Profile
@ziishaned
ziishaned / git-tag.sh
Last active February 19, 2018 06:31
Remove a local and remote tag and push a new tag pointing to HEAD
### Remove a local tag
```bash
git tag -d <tag>
```
### Remove a remote tag
```bash
git push --delete origin <tag>
@ziishaned
ziishaned / appium-driver-codeception.md
Last active March 6, 2018 11:46
Appium Driver Codeception

Steps to follow for generating routes

  1. Open the routes file.
  2. Copy the METHOD_MAP object
  3. Open chrome dev tools and paste the object inside console tab and hit enter
  4. Now run the following command
    console.log(JSON.stringify(METHOD_MAP))
  5. Now copy the output and paste it in AppiumCommandRoute.json
@ziishaned
ziishaned / output.json
Last active May 21, 2024 15:57
Build a tree from a flat array in PHP
{
"5a969a6fe799f7cbe9083122": {
"_id": "5a969a6fe799f7cbe9083122",
"name": "Tajawal",
"parent": null,
"created_by": "5a8d84b8e799f70a157f8211",
"update_at": "1519819375891",
"created_at": "1519819375891",
"children": {
"5a969f5ce799f7cbe9083123": {
@ziishaned
ziishaned / untracted-files.md
Created March 5, 2018 06:18
Remove untracted files git
git clean -fd
@ziishaned
ziishaned / meta-characters.md
Last active March 28, 2018 13:18
Meta Characters
Meta character Description
. Period matches any single character except a line break.
[ ] Character class. Matches any character contained between the square brackets.
[^ ] Negated character class. Matches any character that is not contained between the square brackets
* Matches 0 or more repetitions of the preceding symbol.
+ Matches 1 or more repetitions of the preceding symbol.
? Makes the preceding symbol optional.
{n,m} Braces. Matches at least "n" but not more than "m" repetitions of the preceding symbol.
(xyz) Character group. Matches the characters xyz in that exact order.
@ziishaned
ziishaned / AuthController.php
Last active December 8, 2022 14:05
JWT authentication for Lumen 5.6
<?php
namespace App\Http\Controllers;
use Validator;
use App\User;
use Firebase\JWT\JWT;
use Illuminate\Http\Request;
use Firebase\JWT\ExpiredException;
use Illuminate\Support\Facades\Hash;
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJibG9nLmRldiIsInN1YiI6IjU5YWEyYTQ3ZjlkYzQxMTU3ODAwNjM0NiIsImlhdCI6MTUwNDYwNTY1MiwiZXhwIjoxNTA0NjA5MjUyfQ.F-7q5gR7TnLFaHxKhOiacgPlOzAYGgQ1lu5mZ_WWnqI"
}
@ziishaned
ziishaned / JwtMiddleware.php
Created April 16, 2018 07:43
JWT Middleware
<?php
namespace App\Http\Middleware;
use Closure;
use Exception;
use App\User;
use Firebase\JWT\JWT;
use Firebase\JWT\ExpiredException;
@ziishaned
ziishaned / .env
Created April 16, 2018 07:49
JWT authentication for Lumen 5.6
APP_ENV=local
APP_DEBUG=true
APP_KEY=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
CACHE_DRIVER=file
@ziishaned
ziishaned / 2017_09_05_115448_create_users_table.php
Created April 16, 2018 07:50
JWT authentication for Lumen 5.6
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void