This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Implement a method to perform basic string compression using the counts of repeated/consecutive characters. Such as, the string "aaabbbccd" would become a3b3c2d1. If the compressed converted string does not become smaller than the original string, please return the original string. | |
**/ | |
function compress_string($word) { | |
$word = strtolower($word); | |
$compressed_word = ""; | |
$prev_letter = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int n, i; | |
scanf("%d",&n); | |
for (i = 1; i <= n; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step (1) - Create a middleware; which use to handle the Request data. | |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class TrimRequestInputData | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/User/SublimeLinter/Facebook (SL).tmTheme", | |
"font_face": "Fira Code", | |
"font_options": | |
[ | |
"gray_antialias" | |
], | |
"font_size": 14, | |
"ignored_packages": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loggin to Mysql | |
# Set proper value in ( DB_NAME, NEW_DB_USER_NAME, PASSWORD_FOR_NEW_USER ) | |
-> GRANT ALL PRIVILEGES ON DB_NAME.* To 'NEW_DB_USER_NAME'@'localhost' IDENTIFIED BY 'PASSWORD_FOR_NEW_USER'; | |
-> FLUSH PRIVILEGES; | |
# For Delete User | |
-> DROP USER ‘demo’@‘localhost’; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
rpm -Uvh http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-2.el6.nux.noarch.rpm | |
yum update | |
yum -y install ffmpeg ffmpeg-devel | |
ffmpeg -version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/User/SublimeLinter/Facebook (SL).tmTheme", | |
"font_face": "Fira Code", | |
"font_options": | |
[ | |
"gray_antialias" | |
], | |
"font_size": 14, | |
"ignored_packages": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$type = $request->input('email_or_phone'); | |
$user = UserVerify::where('user_id', $request->input('user_id')) | |
->where(function($query) use ($type, $request) { | |
if ($type == 1) { | |
return $query->where('email', $request->input('email')); | |
} | |
if ($type == 2) { | |
return $query->where('mobile_no', $request->input('mobile_no')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Technique 1: | |
array_walk_recursive($YOUR_ARRAY, function (&$item, $key) { | |
$item = null === $item ? '' : $item; | |
}); | |
# Technique 2: | |
array_walk($YOUR_ARRAY, function(&$item) { | |
$item = strval($item); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$aRanks = array(); | |
foreach($data['emp_list'] as $aEntry) { | |
$aRanks[$aEntry->CurrentDepartmentID][] = $aEntry; | |
} | |
dd($aRanks); |
NewerOlder