This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
function getColumnNumberByName(name, sheet) { | |
if (!sheet) { | |
sheet = SpreadsheetApp.getActiveSheet() | |
} | |
var headers = sheet.getDataRange().offset(0, 0, 1).getValues()[0] | |
var column = false | |
for (var i = 0; i < headers.length; i++) { | |
if (headers[i].trim() === name) { |
<?php | |
namespace App\Http\Resources; | |
use App\Helpers\ResourcePaginationHelper; | |
use Illuminate\Http\Resources\Json\ResourceCollection; | |
class ProductsResourceCollection extends ResourceCollection | |
{ | |
/** |
// Source: https://stackoverflow.com/questions/30688909/how-to-get-primary-key-value-with-entity-framework-core | |
public static class DbContextKeyExtensions | |
{ | |
private static readonly ConcurrentDictionary<Type, IProperty[]> KeyPropertiesByEntityType = new ConcurrentDictionary<Type, IProperty[]>(); | |
public static string KeyValuesAsString(this EntityEntry entry) | |
{ | |
if (entry == null) | |
{ |
import React, { FC } from 'react'; | |
import { useSocket } from '@myapp/hooks'; | |
import {Order} from '@myapp/models'; | |
export const OrdersComponent: FC = () => { | |
const [orders,setOrders] = useState<Order[]>(); | |
function addNewOrder(neworder:Order) { |
function get_instagram_users_data($pageUrl) { | |
$url = $pageUrl; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); | |
curl_setopt($ch, CURLOPT_HEADER, false); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_REFERER, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); | |
$result = curl_exec($ch); |
// jQuery import | |
global.jQuery = require('jquery'); | |
var $ = global.jQuery; | |
window.$ = $; | |
// Bootstrap 4 depends on Popper.js | |
// Popper.js import | |
//import Popper from 'popper.js'; | |
//window.Popper = Popper; |
<?php | |
public static function arabicToPersian($string) | |
{ | |
$characters = [ | |
'ك' => 'ک', | |
'دِ' => 'د', | |
'بِ' => 'ب', | |
'زِ' => 'ز', | |
'ذِ' => 'ذ', | |
'شِ' => 'ش', |
<?php | |
/* If you use Codeigniter framework, uncomment following ↓ line */ | |
//defined('BASEPATH') OR exit('No direct script access allowed'); | |
/* | |
* @name Shamsi Date (SDate) | |
* @author Erfan Sahafnejad <[email protected]/> | |
* @copyright 2015 P30Skill Development Team (http://P30Skill.ir) | |
* @version 1.0 | |
* @link www.P30Skill.ir |
function checkNC(code) { | |
var L = code.length; | |
if (L < 8 || parseInt(code, 10) == 0) return false; | |
code = ('0000' + code).substr(L + 4 - 10); | |
if (parseInt(code.substr(3, 6), 10) == 0) return false; | |
var c = parseInt(code.substr(9, 1), 10); | |
var s = 0; | |
for (var i = 0; i < 9; i++) | |
s += parseInt(code.substr(i, 1), 10) * (10 - i); |