project_files
, который потом можно подключать к php через --volumes-from project_files
FROM ubuntu
RUN apt-get update && apt-get install -y git
RUN mkdir /root/.ssh/
COPY id_rsa /root/.ssh/id_rsa
# Add bitbuckets key
RUN ssh-keyscan bitbucket.org >> /root/.ssh/known_hosts
# CLone repo
RUN git clone git@bitbucket.org:username/projectname.git /project_files
# Create volume
VOLUME /project_files
id_rsa
и билдите docker build -t myproject/files .
и создаёте контейнер docker create --name project_files myproject/files /bin/true
docker pull composer/composer
Надо его запустить и установить зависимости вашего проекта, подключив тот контейнер с файлами проекта:docker run --rm --volumes-from project_files -w "/project_files" composer install
docker run \
--name myproject_php \
--volumes-from project_files \
php:5-fpm
* 13,14 17 7 * /usr/bin/php votefake.php >/dev/null 2>&1
* 9,10 19 7 * /usr/bin/php votefake.php >/dev/null 2>&1
crontab -e
sudo crontab -e -u www-data
Object.keys(App)
и вызвать каждую:var App = {
Function_1: function(){ console.log(1); },
Function_2: function(){ console.log(2);},
};
Object.keys(App).forEach( e => App[e]() );
Object.values(App).forEach( Function.prototype.call, Function.prototype.call);
не используйте этот вариант в production! /**
* Webhook handler
*
* @return array
* @throws \TelegramBot\Api\InvalidJsonException
*/
public function run()
{
if ($data = BotApi::jsonValidate($this->getRawBody(), true)) {
$this->handle([Update::fromResponse($data)]);
}
}
parseInt( $('.num').first().text())
var $el = $('#container'), digits = $el.children().detach();
digits.sort(function(a,b){
return parseInt($(a).text()) - parseInt($(b).text());
});
$el.append(digits);
$('.num').each(function(i,e){ $(e).text(++i)});
stroke-dasharray,
скруглёные концы через stroke-linecap="round"
, нужную толщину через stroke-width
и цвет через stroke
: <svg width="800px" height="369.643px" viewBox="0 0 800 369.643" enable-background="new 0 0 800 369.643">
<path fill="none"
stroke="#596E7A"
stroke-width="10"
stroke-miterlimit="10"
stroke-dasharray="25,25"
stroke-linecap="round"
d="M34.762,225.595c25.084,109.862,211.31,151.786,342.262,108.929 c129.701-42.448,212.358-186.755,180.357-288.095C543.096,1.19,460.075-8.983,449.372,67.834
c-15.801,113.4,167.532,164.904,318.724,34.547"/>
</svg>
false
и число 0
, которые не будем считать пустым значением.var data = {1: "", 2: "123", 3:""};
function anyEmpty(obj) {
var p, v;
for( p in obj) {
v = obj[p];
if( !obj.hasOwnProperty(p)) continue;
if( v === false || v === 0) continue;
if( !v ) return true;
}
return false;
}
anyEmpty(data) // true
$array['response']['items'][0]
foreach( $array['response']['items'] as $n => $item) {
$this->edit->text = $item['title'];
$this->textArea->text = $item['description'];
$this->edit6->text = $item['price']['currency']['name'];
$this->edit3->text = $item['category']['name'];
$this->edit5->text = $item['thumb_photo'];
$this->editAlt->text = (int)$item['price']['text'];
// output current version of $this
}