This file contains hidden or 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 | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Response; | |
class CORS | |
{ |
This file contains hidden or 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
{"BDT":{"country":"Bangladesh","capital":"Dhaka","country_code_iso2":"BD","currency_code":"BDT","currency_symbol_int":"Tk","currency_symbol":"\u09f3","currency_name":"Bangladeshi Taka","rate":108.746847},"EUR":{"country":"Ireland","capital":"Dublin","country_code_iso2":"IE","currency_code":"EUR","currency_symbol_int":"\u20ac","currency_symbol":"\u20ac","currency_name":"Euro","rate":0.92065300000000005},"XOF":{"country":"Togo","capital":"Lome","country_code_iso2":"TG","currency_code":"XOF","currency_symbol_int":"CFA","currency_symbol":"CFA","currency_name":"CFA Franc BCEAO","rate":603.90879600000005},"BGN":{"country":"Bulgaria","capital":"Sofia","country_code_iso2":"BG","currency_code":"BGN","currency_symbol_int":"BGN","currency_symbol":"\u043b\u0432.","currency_name":"Bulgarian Lev","rate":1.8008},"BAM":{"country":"Bosnia and Herzegovina","capital":"Sarajevo","country_code_iso2":"BA","currency_code":"BAM","currency_symbol_int":"KM","currency_symbol":"KM","currency_name":"Bosnia-Herzegovina Convertible Mark"," |
This file contains hidden or 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 | |
if (isset($_POST['unit'])) { | |
$total = 0; | |
$unit = (int) $_POST['unit']; | |
function calculate($unit, $range, $price) | |
{ | |
$xunit = $range[1] - $range[0] + 1; | |
if ($unit <= $xunit && $unit > 0) { | |
$bill = $unit * $price; |
This file contains hidden or 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
# Set SMS to Text Mode | |
AT+CMGF=1 | |
# Set SMS to PDU Mode | |
AT+CMGF=0 |
This file contains hidden or 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
service vesta stop | |
rm -f /etc/yum.repos.d/vesta.repo | |
yum erase vesta* -y | |
rm -f /etc/apt/sources.list.d/vesta.list | |
rm -rf /usr/local/vesta | |
yum erase httpd httpd-tools apr apr-util vesta nginx httpd exim vesta* -y | |
yum autoremove -y |
This file contains hidden or 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
server { | |
listen ip:port; | |
server_name domain.name; | |
root root_folder; | |
index index.php index.html index.htm; | |
location / { | |
location = / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} |
This file contains hidden or 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 | |
//store images | |
public function store(Request $request) | |
{ | |
try{ | |
if($request->hasFile('file')){ //max 921600bytes or, 900KB - this value will be changed dynamically from settings | |
foreach ($request->file as $file) { |
This file contains hidden or 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
#----------------------------------------------------------# | |
# WEB # | |
#----------------------------------------------------------# | |
# Web template check | |
is_web_template_valid() { | |
if [ ! -z "$WEB_SYSTEM" ]; then | |
tpl="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$1.tpl" | |
stpl="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$1.stpl" | |
if [ ! -e "$tpl" ] || [ ! -e "$stpl" ]; then |
This file contains hidden or 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
$vuetables = new EloquentVueTables; | |
$model = new Product; | |
$model = $model->where('status', 1); | |
$filter = []; | |
if ($request->has('q') && $request->q != "undefined") { | |
$this->q = '%' . $request->q . '%'; | |
// Named Sort | |
$model = $model->where(function ($query) { | |
$query->where('name', 'LIKE', $this->q) | |
->orWhere('short_description', 'LIKE', $this->q) |
This file contains hidden or 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 VeeValidate from 'vee-validate'; | |
Vue.use(VeeValidate, { inject: false }); | |
VeeValidate.Validator.extend('mobile', { | |
getMessage: field => `The number is not valid for Bangladesh.`, | |
validate: value => { | |
var strongRegex = new RegExp("^(8801[756891]{1}[0-9]{8}|01[756891]{1}[0-9]{8})$"); | |
if(value=='') return true; | |
return strongRegex.test(value); | |
} | |
}); |