Skip to content

Instantly share code, notes, and snippets.

View sharifbdp's full-sized avatar

Sharif sharifbdp

View GitHub Profile
/**
* 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) {
@sharifbdp
sharifbdp / gist:91457ea4af012ee5f30d
Created February 25, 2016 05:11
Image Upload into S3 (CodeIgniter)
/**
* 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) {
import requests
url = 'http://localhost/myApp/api/v1'
params = {
'userid' : '250',
'gpslat': '30.098',
'gpslng': '40.000',
'speed': '20'
}
<?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);
$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
সার্ভারের প্রাথমিক এবং ব্যাসিক কনফিগারেশন
1. নতুন তৈরি হওয়া সার্ভারে root ইউজার হিসেবে লগইন করুন নিচের কমান্ড দিয়ে
ssh root@SERVER_IP_ADDRESS
2. নতুন একটি ইউজার তৈরি করতে কমান্ড দিন নিচের মত। এখানে নতুন ইউজারের নাম demo
adduser demo
$aRanks = array();
foreach($data['emp_list'] as $aEntry) {
$aRanks[$aEntry->CurrentDepartmentID][] = $aEntry;
}
dd($aRanks);
# 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);
$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'));
}
{
"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":