Skip to content

Instantly share code, notes, and snippets.

View amitmerchant1990's full-sized avatar

Amit Merchant amitmerchant1990

View GitHub Profile
@amitmerchant1990
amitmerchant1990 / keyboard_shortcut.js
Last active August 29, 2015 13:56
IMPLEMENT KEYBOARD SHORTCUTS FOR YOUR WEBSITE
$(document).ready(function() {
// I have used $(this) so it "listens" on any part of the webpage (document)
// Change this to a single or series of elements if required
$(this).live("keyup", function(e) {
if($("input, textarea").is(":focus")) {
// Do nothing because the user might be typing
return false;
} else {
switch(e.keyCode) {
@amitmerchant1990
amitmerchant1990 / questions.md
Last active July 12, 2019 04:11
Questions
1) What is Asynchronous call?
  • A function that enables processing to continue without waiting for function to return the value.
2) What is Full-text search ?
  • In this we can match a word or phrase in multiple columns and fetch rows accordingly. The Full-text searches are supported for MyISAM tables only ex. : SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('database');

My arbitrary thoughts

  • There are only 0b10 kinds of people; those who understand binary and those who don’t.
  • There is a dream I'm living.. There is a life I'm dreaming of.
  • Keep a green tree in your heart, the bird will come automatically.
  • For too long, you and I've been quiet..RISE UP!
@amitmerchant1990
amitmerchant1990 / brand_new_repo_git.md
Last active July 23, 2019 22:27
Setup a brand new repo on Git
1) Configure your user and email for Git via the following command.
  • configure the user which will be used by git

  • Of course you should use your name

    git config --global user.name "Example Surname"

  • Same for the email address

    git config --global user.email "your.email@gmail.com"

@amitmerchant1990
amitmerchant1990 / ajax_abort.md
Last active August 29, 2015 13:56
JavaScript snippet for aborting ajax rquest if previous call has not been completed
jQuery(document).ready(function(){
    var currentRequest = null;
    jQuery('#searchbox').keyup(function() {
        var text = jQuery(this).val();
        currentRequest = jQuery.ajax({
            type: 'POST',
            data: 'search_text=' + text,
            url: 'AJAX_URL',
 beforeSend : function() { 

Keybase proof

I hereby claim:

  • I am amitmerchant1990 on github.
  • I am amitmerchant (https://keybase.io/amitmerchant) on keybase.
  • I have a public key whose fingerprint is FBBA 8B64 4897 0F86 CAE1 1B7B 4F92 A08D 6724 0E6A

To claim this, I am signing this object:

@amitmerchant1990
amitmerchant1990 / gist:34061136cc0a1fe926402814ba111f86
Created August 26, 2016 08:36
CSS : Center Text in middle of page
h1 {
left: 0;
line-height: 200px;
margin-top: -100px;
position: absolute;
text-align: center;
top: 50%;
width: 100%;
}
https://maven-global.slack.com/files/amit.merchant/F259FSJUW/correo-darwin-x64.zip
@amitmerchant1990
amitmerchant1990 / git-ingredients.md
Last active August 31, 2016 12:50
git-ingredients
git install on ubuntu
sudo apt-get install git

point your local repository to remote repository

git remote add origin git@....repo_url
@amitmerchant1990
amitmerchant1990 / stylish.css
Last active December 28, 2018 00:32
GitHub Fixed Header for better accessibility.
/**
1. Install the Stylish(https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en) extension for Chrome.
2. Open up extension options and paste the whole CSS mentioned below.
3. Specify the domain name to be `github.com`.
4. Add a title and save.
*/
.header {
padding-top: 10px;
padding-bottom: 10px;