This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( have_posts() ) : query_posts('p=1'); | |
while (have_posts()) : the_post(); ?> | |
<?php the_title(); ?> | |
<?php the_content(); ?> | |
<?php the_post_thumbnail(array(100, 100)); ?> | |
<? endwhile; endif; wp_reset_query(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$allowedExtensions = ['jpg', 'png', 'gif']; | |
$extension = pathinfo($srcFileName, PATHINFO_EXTENSION); | |
if (!in_array($extension, $allowedExtensions)) { | |
$error = 'Загрузка файлов с таким расширением запрещена!'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
через терминал | |
в одном проекте | |
git config core.autocrlf true | |
во всех проектах | |
git config --global core.autocrlf true | |
или в файле проекта .git\config | |
[core] | |
autocrlf = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Определение функций на этапе инициализации</title> | |
</head> | |
<body> | |
<script> | |
var utils = { | |
addListener: null, | |
removeListener: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arr = array( | |
array( | |
'id' => 12345, | |
'date' => 277345533 | |
), | |
array( | |
'id' => 12345, | |
'date' => 277345533 | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1. Получаем хэш-код коммита, к которому хотим вернуться. | |
#2. Заходим в папку репозитория и пишем в консоль: | |
# $ git reset --hard ХЭШ-КОМИТА | |
# $ git push --force | |
# Или | |
$ git reset --hard HEAD~1 | |
$ git push --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($i in iex 'git ls-files -i --exclude-from=.gitignore') { git rm --cached $i } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function generate_tree($data, $parent = 'parent_id', $childs = 'childs') | |
{ | |
$tree = array(); | |
foreach ($data as $id => &$node) | |
{ | |
if (!$node[$parent] || !isset($data[$node[$parent]])) | |
{ | |
unset($node[$parent]); | |
$tree[$id] = &$node; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt update | |
sudo apt dist-upgrade -y | |
sudo apt install openssh-server -y | |
sudo ifconfig | |
# если нет ifconfig, то устанавливаем | |
sudo apt install net-tools | |
#устанавливаем nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name laravel.local; | |
root /var/www/laravel/public; | |
index index.php index.html index.htm; | |
client_max_body_size 64m; | |
location / { |
OlderNewer