Skip to content

Instantly share code, notes, and snippets.

View saaiful's full-sized avatar
🏠
Working from home

Saiful Islam saaiful

🏠
Working from home
View GitHub Profile
# Set SMS to Text Mode
AT+CMGF=1
# Set SMS to PDU Mode
AT+CMGF=0
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
@saaiful
saaiful / sendy.conf
Created May 3, 2019 12:44
Nginx configuration file example for Sendy (http://sendy.co/).
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;
}
<?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) {
@saaiful
saaiful / domain.sh
Created October 31, 2018 04:41
Vesta php pool fix
#----------------------------------------------------------#
# 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
@saaiful
saaiful / mobile.js
Created June 23, 2018 17:32
Vee-Validate mobile number validator (Bangladesh)
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);
}
});
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_name">Lightning</string>
<string name="action_new_tab">New tab</string>
<string name="action_share">Share</string>
<string name="action_history">History</string>
<string name="action_bookmarks">Bookmarks</string>
<string name="action_downloads">Downloads</string>
<string name="action_add_bookmark">Add bookmark</string>
{
"always_show_minimap_viewport": true,
"auto_complete_triggers":
[
{
"characters": "bs4",
"selector": "text.html"
}
],
"bold_folder_labels": true,
// Men's Vogue/Passion/Obsession
$c = Category::create(['parent' => 0, 'en_name' => "Men's Vogue/Passion/Obsession", 'bn_name' => "Men's Vogue/Passion/Obsession", 'keywords' => '', 'attributes' => '']);
// Pants
$c_1 = Category::create(['parent' => $c->id, 'en_name' => "Pants", 'bn_name' => "Pants", 'keywords' => 'Pants', 'attributes' => '']);
$attributes = [];
$attributes['brand'] = ['required' => true, 'type' => 'tag', 'options' => ['Raymond', 'Clothy'], 'multiple' => false, 'manual' => true];
$attributes['material'] = ['required' => true, 'type' => 'tag', 'options' => ['Stitch', 'Vintage'], 'multiple' => false, 'manual' => true];
$attributes['color'] = ['required' => false, 'type' => 'tag', 'options' => ['Blue', 'Light Blue', 'White', 'Black', 'Deep Blue'], 'multiple' => true, 'manual' => true];
$attributes['size'] = ['required' => true, 'type' => 'tag', 'options' => ['S', 'M', 'XL', 'XXL'], 'multiple' => true, 'manual' => true];