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 / output.json
Last active February 11, 2024 16:46
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 / package-name.md
Created February 2, 2018 14:41
Get the Main Package Name of an .apk File

Simply use this command to get package name:

aapt dump badging {apk-file.apk} | grep package | awk '{print $2}' | sed s/name=//g | sed s/\'//g

Getting main (launcher) activity is similar:

aapt dump badging {apk-file.apk} | grep launchable-activity: | awk '{print $2}' | sed s/name=//g | sed s/\'//g
@ziishaned
ziishaned / README.md
Last active January 27, 2023 07:51
Raspberry Pi

WiFi

touch wpa_supplicant.conf

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
@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;
@ziishaned
ziishaned / README.md
Created September 8, 2022 08:43
Set the iTerm tab title to the current directory
  1. Open your ~/.zshrc file and put following inside of it:
    DISABLE_AUTO_TITLE="true"
    echo -ne "\e]1;\a"
  2. Then open the settings for iTerm2 and select PWD from the title dropdown: Screen Shot 2022-09-06 at 11 24 22 AM

Finally the tab title for iTerm2 will look something like below:

@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 / vscode-italics.json
Created February 18, 2022 07:09 — forked from dev01d/vscode-italics.json
VSCode italics in (almost) any theme
{
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"keyword.control",
"keyword.operator.new",
"keyword.operator.assignment",
"keyword.operator.arithmetic",
@ziishaned
ziishaned / app-ads.txt
Created November 21, 2020 10:43
Manage Your Subscriptions
google.com, pub-3829457573832682, DIRECT, f08c47fec0942fa0
@ziishaned
ziishaned / android_instructions.md
Created December 19, 2019 21:55 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@ziishaned
ziishaned / markdown.css
Created November 5, 2019 14:32
Intellij Markdown Github css
body {
font-family: "Operator Mono" !important;
font-size: 16px !important;
line-height: 1.5 !important;
}
h1 {
font-size: 2em !important;
margin: .67em 0 !important;
}