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
/** | |
* File Upload into Amazon S3 | |
* @param string $input_name | |
* @param int $restaurant_id | |
* @return string/bolean | |
*/ | |
public function _fileUpload($input_name, $restaurant_id) { | |
if (isset($_FILES[$input_name]) && ($_FILES[$input_name]) != null) { |
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
/** | |
* File Upload into Amazon S3 | |
* @param string $input_name | |
* @param int $restaurant_id | |
* @return string/bolean | |
*/ | |
public function _fileUpload($input_name, $restaurant_id) { | |
if (isset($_FILES[$input_name]) && ($_FILES[$input_name]) != NULL) { |
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
import requests | |
url = 'http://localhost/myApp/api/v1' | |
params = { | |
'userid' : '250', | |
'gpslat': '30.098', | |
'gpslng': '40.000', | |
'speed': '20' | |
} |
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 | |
function getx($img, $font, $text) { | |
$image_width = imagesx($img); | |
$string_width = imagefontwidth($font) * strlen($text); | |
return $string_x_position = ($image_width - $string_width) / 2; | |
} | |
function gety($img, $font, $text) { | |
$image_height = imagesy($img); |
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
$string_to_sign = 'ASASASASASASA'; | |
$password = '123456'; | |
$signature = base64_encode(hash_hmac("sha256", $string_to_sign, $password, True)); | |
echo($signature); | |
#https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/14.04/providers/virtualbox.box |
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
সার্ভারের প্রাথমিক এবং ব্যাসিক কনফিগারেশন | |
1. নতুন তৈরি হওয়া সার্ভারে root ইউজার হিসেবে লগইন করুন নিচের কমান্ড দিয়ে | |
ssh root@SERVER_IP_ADDRESS | |
2. নতুন একটি ইউজার তৈরি করতে কমান্ড দিন নিচের মত। এখানে নতুন ইউজারের নাম demo | |
adduser demo |
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); |
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
$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
{ | |
"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": |
OlderNewer