Skip to content

Instantly share code, notes, and snippets.

View sinamiandashti's full-sized avatar
🏋️‍♀️
Focusing

sina miandashti sinamiandashti

🏋️‍♀️
Focusing
View GitHub Profile
<?php
namespace App\Http\Middleware;
use Closure;
use Menu;
class AdminMenuGenerator
{
/**
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
function start_progress {
while true
do
echo -ne "#"
sleep 1
done
}
function stop_progress {
kill $1
wait $1 2>/dev/null
@sinamiandashti
sinamiandashti / Verta.php
Created August 8, 2018 06:58
vendor/hekmatinasser/verta/src/Verta.php
<?php
namespace Hekmatinasser\Verta;
/*
* This file is part of the Jalali package.
*
* (c) Nasser Hekmati <hekmati.nasser@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@sinamiandashti
sinamiandashti / fail.php
Created December 13, 2017 09:26
2 method of query in IPTV
<?php
$query = "SELECT SQL_CALC_FOUND_ROWS notifications.* FROM notifications WHERE";
if (!empty($filters['subsystem_id'])) {
$query .= " notifications.subsystem_id=:subsystem_id";
}
$stm = $this->db->prepare($query);
$stm->execute([':subsystem_id' => $filters['subsystem_id']]);
$data = [];
while ($row = $stm->fetch(\PDO::FETCH_ASSOC)) {
@sinamiandashti
sinamiandashti / Pm24 new api
Last active June 21, 2017 08:04
Pm24 new api
Payment24 new API!
===================
[TOC]
Here is newly added api's for mobile applications
----------
@sinamiandashti
sinamiandashti / gist:8487560
Created January 18, 2014 07:49
double field-sets output in bootstrap zf2 module
<fieldset class="form-control"><fieldset class="form-inline"><div class="form-group "><input name="hostmacros[0][macro]" placeholder="{$MACRO}" class="form-control" type="text" value=""></div>
<div class="form-group "><input name="hostmacros[0][value]" placeholder="value" class="form-control" type="text" value=""></div>
</fieldset><span data-template="&lt;fieldset class=&quot;form-inline&quot;&gt;&lt;div class=&quot;form-group &quot;&gt;&lt;input name=&quot;hostmacros[__index__][macro]&quot; placeholder=&quot;{$MACRO}&quot; class=&quot;form-control&quot; type=&quot;text&quot; value=&quot;&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;form-group &quot;&gt;&lt;input name=&quot;hostmacros[__index__][value]&quot; placeholder=&quot;value&quot; class=&quot;form-control&quot; type=&quot;text&quot; value=&quot;&quot;&gt;&lt;/div&gt;
&lt;/fieldset&gt;"></span></fieldset>
@sinamiandashti
sinamiandashti / html
Created January 15, 2014 06:26
output ... neilme bootstrap inline form field
<fieldset>
<fieldset class="form-inline"><div class="form-group "><input name="hostmacros[0][macro]" placeholder="{$MACRO}" class="form-control" type="text" value=""></div>
<div class="form-group "><input name="hostmacros[0][value]" placeholder="value" class="form-control" type="text" value=""></div>
</fieldset><span data-template="&lt;fieldset class=&quot;form-inline&quot;&gt;&lt;div class=&quot;form-group &quot;&gt;&lt;input name=&quot;hostmacros[__index__][macro]&quot; placeholder=&quot;{$MACRO}&quot; class=&quot;form-control&quot; type=&quot;text&quot; value=&quot;&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;form-group &quot;&gt;&lt;input name=&quot;hostmacros[__index__][value]&quot; placeholder=&quot;value&quot; class=&quot;form-control&quot; type=&quot;text&quot; value=&quot;&quot;&gt;&lt;/div&gt;
&lt;/fieldset&gt;"></span></fieldset>
@sinamiandashti
sinamiandashti / Host.php
Last active January 2, 2016 13:59
TWB bundle inline layout in fieldset issue
$this->add(array(
'type' => 'Zend\Form\Element\Collection',
'name' => 'hostmacros',
'twb-layout' => \TwbBundle\Form\View\Helper\TwbBundleForm::LAYOUT_INLINE,
'options' => array(
// 'label' => 'Please choose categories for this product',
// 'count' => 2,
'twb-layout' => \TwbBundle\Form\View\Helper\TwbBundleForm::LAYOUT_INLINE,
'should_create_template' => true,
@sinamiandashti
sinamiandashti / index.php
Last active December 23, 2015 08:19
aaab.ir multilang
<?
if (array_key_exists('lang', $_GET)) {
$currentlang = $_GET['lang'];
} else {
$currentlang = 'en';
}
$langdataArray = array(
'texten' => 'textfa',
);