Skip to content

Instantly share code, notes, and snippets.

@jamalnasir
jamalnasir / Recruitment Companies in UAE
Last active April 28, 2024 07:50
Recruitment Companies in UAE
Accel HR Consulting https://www.accel-hrconsulting.com/
Accel HR Consulting https://lnkd.in/dcehjNDJ
ACR World International Search https://www.acrworld.com/
Adecco Middle East https://www.adeccome.com/
AIQU https://aiqusearch.com/
Ajeets Management & Manpower Consultancy https://ajeets.com/
Ajeets Management & Manpower Consultancy http://www.ajeets.com/
Alliance Recruitment Agency https://www.alliancerecruitmentagency.ae/
Alliance Recruitment Agency https://lnkd.in/d_nvMGWh
Antal International https://www.antal.com/
# SHOW THE DOCKER VERSION
docker version
# DISPLAY LIVE STREAM OF CONTAINERS ON DOCKER
docker stats
# DISPLAY SYSTEM-WIDE INFORMATION OF DOCKER
docker info
# LIST ALL THE IMAGES
@jamalnasir
jamalnasir / combination.php
Created August 5, 2018 07:50
Letters Combinations
function everyCombination($array) {
try {
// initialize by adding the empty set
$results = [[]];
foreach ($array as $element) {
$this->line($element);
foreach ($results as $combination) {
@jamalnasir
jamalnasir / camel_case.sql
Last active January 16, 2023 20:17
Get Camel Case of a String in MySQL
DELIMITER $$
CREATE FUNCTION `camel_case`(str varchar(128)) RETURNS varchar(128)
BEGIN
DECLARE n, pos INT DEFAULT 1;
DECLARE sub, proper VARCHAR(128) DEFAULT '';
if length(trim(str)) > 0 then
WHILE pos > 0 DO
set pos = locate(' ',trim(str),n);
@jamalnasir
jamalnasir / FlashingDiv.html
Created May 7, 2018 11:20
Flash a DIV element using jQuery
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
</head>
<body>
<div id="divtoBlink">
<h1>This is the element to blink</h1>
@jamalnasir
jamalnasir / email_attachment.php
Last active April 29, 2018 07:18
Sending email with attachment in core PHP
<?php
try {
$fileatt = "";
$fileatt_name = $fileatt. "file.pdf";
$email_from = "support@mathkings.com";
$email_subject = "attachment test-subject";
$email_txt = "attachment test-body";
$email_to = "janasir35@gmail.com";
@jamalnasir
jamalnasir / onlynumeric.js
Created October 25, 2017 07:23
This script allow only numeric values in the text fields
$('body').on('keydown', 'input[name=random]', function(e) {
return ((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode == 173 || e.keyCode == 8 || e.keyCode == 9) ? true : false;
});
@jamalnasir
jamalnasir / search_table.js
Last active October 9, 2017 07:14
Search Table with JS/jQuery
$(function(){
var searchTable = function(valueToSearch) {
var value = '';
if(valueToSearch == ''){
$('#filtered tbody tr').fadeIn('fast');
return;
}
@jamalnasir
jamalnasir / pushall.sh
Last active October 4, 2017 12:32
Clone all branches and tags between remote git repositories
# Clone a temporary copy of your repo
cd /temp
git clone ssh://git@yourrepo/yourrepo.git
cd yourrepo
function branches() {
git branch -r | grep -v '\->';
}
BRANCHES=$(branches)
@jamalnasir
jamalnasir / TerminalBranchName.sh
Created October 1, 2017 08:14
Add Git Branch Name to the Terminal Prompt
sudo nano ~/.bash_profile
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
# If you are using an existing Terminal session, don’t forget to make the changes take effect by sourcing the file with the command
source ~/.bash_profile