Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Jitendra adhocore

🎯
Focusing
View GitHub Profile
@adhocore
adhocore / qwerty.php
Created Dec 13, 2015
map English alphabets to their position in qwerty layout keyboard, and reverse
View qwerty.php
<?php
/*
* QWERTY encode decode
*
* qwerty_encode maps English alphabets to their
* position in qwerty layout keyboard like so:
* a -> q, b -> w, c -> e ... etc
*
* qwerty_decode does the reverse
@adhocore
adhocore / maqebot.php
Last active Oct 8, 2017
Maqe Bot (PHP7). Sample usage: `php maqebot.php W5RW5RW2RW1R`
View maqebot.php
<?php
/**
* The Bot.
*/
class Bot
{
const DIR_NORTH = 0;
const DIR_EAST = 1;
const DIR_SOUTH = 2;
@adhocore
adhocore / git-branch.md
Created May 15, 2019
Get current git branch without using `git` command
View git-branch.md
cat .git/HEAD | cut -c17-9999

Useful if you are in docker and dont want to install git in your container :)