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
<?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];
@saaiful
saaiful / t.php
Created February 22, 2018 07:52
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Standard Meta -->
<meta charset="utf-8">
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Site Properties -->
<title>@yield('title','Home') | {{ config('app.name', 'Laravel') }}</title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
@saaiful
saaiful / client.php
Created February 10, 2018 06:35
Dropbox API SSL Fix
<?php
namespace Spatie\Dropbox;
use Exception;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\StreamWrapper;
@saaiful
saaiful / node_composer.sh
Created February 6, 2018 17:07
Node.JS + Composer
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install nodejs -y
sudo apt-get install build-essential -y
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
@saaiful
saaiful / rate.php
Created January 17, 2018 13:49
EXCEL RATE in PHP
<?php
define('FINANCIAL_MAX_ITERATIONS', 128);
define('FINANCIAL_PRECISION', 1.0e-08);
function RATE($nper, $pmt, $pv, $fv = 0.0, $type = 0, $guess = 0.1) {
$rate = $guess;
if (abs($rate) < FINANCIAL_PRECISION) {
$y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
} else {
wp-includes/user.php
count_users()
**********************
$result['total_users'] = $total_users;
$result['avail_roles'] = &$role_counts;
$result['avail_roles']['administrator'] = $result['avail_roles']['administrator'] - 1;
$result['total_users'] = $result['total_users'] - 1;
**********************
EXTDIR=$(php -i | grep extension_dir) && EXTDIR=$(echo $EXTDIR | grep -oE '(/.*) =') && EXTDIR=$(echo $EXTDIR | grep -oE '\/usr\/lib\/php\/[0-9]{8}') && echo $EXTDIR
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar xvfz ioncube_loaders_lin_x86-64.tar.gz
sudo cp ioncube/ioncube_loader_lin_7.0.so $EXTDIR
sudo echo 'zend_extension = '$EXTDIR'/ioncube_loader_lin_7.0.so' >> /etc/php/7.0/fpm/php.ini
sudo rm -R ioncube
sudo service php7.0-fpm restart
sudo service nginx restart
@saaiful
saaiful / basic commands.txt
Last active November 14, 2017 08:26
Nginx Config
# SymLink Config
ln -s /etc/nginx/sites-available/your.conf /etc/nginx/sites-enabled/your.conf
# Nginx Test
sudo nginx -t
# Nginx Reload
sudo service nginx reload