Skip to content

Instantly share code, notes, and snippets.

View sharifbdp's full-sized avatar

Sharif sharifbdp

View GitHub Profile
@sharifbdp
sharifbdp / compress_string.php
Created July 16, 2019 11:34
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.
<?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 = "";
#include <stdio.h>
int main()
{
int n, i;
scanf("%d",&n);
for (i = 1; i <= n; i++) {
# Step (1) - Create a middleware; which use to handle the Request data.
<?php
namespace App\Http\Middleware;
use Closure;
class TrimRequestInputData
{
{
"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":
# 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’;
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
{
"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":
$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'));
}
# 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);
$aRanks = array();
foreach($data['emp_list'] as $aEntry) {
$aRanks[$aEntry->CurrentDepartmentID][] = $aEntry;
}
dd($aRanks);