Skip to content

Instantly share code, notes, and snippets.

@AmrMekkawy
AmrMekkawy / bootsrap_class_list
Created July 29, 2017 12:29 — forked from geksilla/bootsrap_class_list
Bootstrap css class list
.navbar
.caret
.label
.table
.img-responsive
.img-rounded
.img-thumbnail
.img-circle
.sr-only
.lead

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@AmrMekkawy
AmrMekkawy / make-text-field-accepts-only-digits.js
Last active October 6, 2017 00:00
Make a text field accepts only digits
$(function() {
// Remove any character or symbole and keep only
// numbers in the "Reference Number" input field
$("input[type=text]").on("keyup keydown", function() {
var refNumber = keepOnlyNumbers($(this).val());
$(this).val(refNumber);
});
});
// Remove any character or symbol withen
@AmrMekkawy
AmrMekkawy / how-to-access-mysql-through-vagrant.md
Last active January 1, 2018 22:58
How to access MySQL through Vagrant?

How to access MySQL through Vagrant?

# Go to the root of your project
cd /path/to/your/project/root

# Enter vagrant
vagrant ssh

# Access MySQL
@AmrMekkawy
AmrMekkawy / how-to-access-your-project-files-and-folders-through-vagrant.md
Last active January 6, 2019 06:57
How to access your project's files and folders through Vagrant?

How to access your project's files and folders through Vagrant?

# Go to the root of your project
cd /path/to/your/project/root

# Enter vagrant
vagrant ssh

# Access the project's files and folders
@AmrMekkawy
AmrMekkawy / laravel-naming-conventions.md
Last active January 4, 2018 20:05
Laravel Naming Conventions & Best Practices
@AmrMekkawy
AmrMekkawy / toggle-password-visibility.js
Last active February 23, 2018 03:35
Toggle Password Visibility
/**
* If the password input in your form has the name "password", then
* you only need to pass the form object to the function.
* But if your password input has a name other than "password", then you need to add
* a class for it and pass that class name to the function with the form object.
*/
function togglePasswordVisibility($form, passwordInputClass) {
var x;
// If the user gave the password input a class name and passed it to the function
@AmrMekkawy
AmrMekkawy / typescript-tips-and-tricks.md
Last active April 29, 2018 03:53
TypeScript Tips & Tricks

TypeScript Tips & Tricks


How to setup a workspace for your TypeScript project?

# Go to the root of you project
cd /d/path/to/your/project/directory/
@AmrMekkawy
AmrMekkawy / how-to-use-npm.md
Last active August 29, 2018 12:27
How to use npm (Node Package Manager)?

How to use npm (Node Package Manager)?


# Go to your project directory
$ cd /path/to/your/project/directory

@AmrMekkawy
AmrMekkawy / functions.php
Created August 27, 2018 15:30
Force download a file with PHP
<?php
/**
* Force Download
*
* Generates headers that force a download to happen
* Example usage:
* force_download( 'screenshot.png', './images/screenshot.png' );
*
* Source: https://goo.gl/fhTaW4