Skip to content

Instantly share code, notes, and snippets.

View Mr-Kumar-Abhishek's full-sized avatar

Abhishek Kumar Mr-Kumar-Abhishek

View GitHub Profile
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / irc.md
Created March 9, 2019 09:50 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / new empty git branch.md
Created February 23, 2019 07:17 — forked from ozh/new empty git branch.md
Create a new empty branch in Git
$ git checkout --orphan NEWBRANCH
$ git rm -rf .

--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.

You can then start adding files and commit them and they will live in their own branch. If you take a look at the log, you will see that it is isolated from the original log.

@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / hnl.mobileConsole.js
Created December 13, 2018 04:32 — forked from c-kick/hnl.mobileConsole.js
hnl.mobileConsole.js - extends JavaScript's console to display a visual console inside the webpage. Very usefull for debugging JS on mobile devices with no real console. Info and demo: http://www.hnldesign.nl/work/code/mobileconsole-javascript-console-for-mobile-devices/
/*!
* hnl.mobileConsole - javascript mobile console - v1.3.4 - 6/9/2018
* Adds html console to webpage. Especially useful for debugging JS on mobile devices.
* Supports 'log', 'trace', 'info', 'warn', 'error', 'group', 'groupEnd', 'table', 'assert', 'clear'
* Inspired by code by jakub fiala (https://gist.github.com/jakubfiala/8fe3461ab6508f46003d)
* Licensed under the MIT license
*
* Original author: @hnldesign
* Further changes, comments: @hnldesign
* Copyright (c) 2014-2016 HN Leussink
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / remove-blob-git.sh
Last active May 22, 2018 03:26
Remove a blob from git
git filter-branch --index-filter \
'git rm -r --cached --ignore-unmatch <file/dir>' HEAD
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / mysql_ports
Created February 19, 2018 17:10
MySQL ports
3306
8889
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / mysql-import
Created February 15, 2018 12:12
import tables from mysql dump
mysql> use db_name;
mysql> source backup-file.sql;
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / rewrite-history-git.sh
Last active February 6, 2018 16:05
rewrite git history with your new email
git filter-branch -f --env-filter \
"GIT_AUTHOR_NAME='Newname'; GIT_AUTHOR_EMAIL='newemail'; \
GIT_COMMITTER_NAME='committed-name'; GIT_COMMITTER_EMAIL='committed-email';" HEAD
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / gpg-import-and-export-instructions.md
Created June 29, 2017 04:00 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / index.html
Created December 21, 2016 19:37
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="container"></div>
<script>
Install fsnotifier for IntelliJ IDEA on your ARM laptop.
Works better than one might expect with JDK8.
Usage:
$ sh fsnotifierto.sh /opt/idea/bin/
...
Sorry for the truncate insanity.