Skip to content

Instantly share code, notes, and snippets.

View izharaazmi's full-sized avatar
🎯
Focusing

Izhar Aazmi izharaazmi

🎯
Focusing
View GitHub Profile
@izharaazmi
izharaazmi / git-pluck-branch-as-separate-repo.sh
Created November 27, 2023 05:18
Extract a branch from a repo into a separate Repo when the branch is unrelated to the original repo with zero common files. This preservers original author name and commit date and removes any conflicting files completely.
cd /Users/izhar/Sites/my-source-repo || exit
echo "Reset current branch to prevent checkout errors"
git reset --hard
echo "Checkout the branch to extract, assumed 'dev'"
git checkout dev
echo "Delete destination branch if exists, assumed 'dex'"
git branch -D dex
@izharaazmi
izharaazmi / create_repo_labels.sh
Created April 28, 2022 11:49 — forked from liuderchi/create_repo_labels.sh
To Create Labels for your Repo
#!/bin/bash
set -e
# NOTE to create labels for your repo
# to support types from commit message guide (feat, fix, docs, style, refactor, test, chore)
# by hitting GitHub API v3
#
# https://developer.github.com/v3/issues/labels/#create-a-label
# https://gist.github.com/caspyin/2288960
@izharaazmi
izharaazmi / circle-of-death.php
Last active March 22, 2021 12:20
N number of people are standing in a circle with person 1 having a gun. He kills the next person and handovers the gun to next alive person. This continues until only one person survives. Find out the survivor.
<?php
class CircleOfDeath
{
protected $size;
protected $list;
protected $current;
@izharaazmi
izharaazmi / ICS.php
Created June 25, 2019 18:26 — forked from jakebellacera/ICS.php
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*