Skip to content

Instantly share code, notes, and snippets.

View Lysindr's full-sized avatar

Alexey Lysindr

  • Ukraine
View GitHub Profile
@Lysindr
Lysindr / index.php
Created September 22, 2016 07:41
wordpress Loop
<h2 class="category-name popular-posts">Popular Posts</h2>
<?php
$popular_post = new WP_Query( array( 'posts_per_page' => '7', 'paged' => $paged ) );
if ( $popular_post -> have_posts() ) :
while ( $popular_post -> have_posts() ) : $popular_post->the_post();
?>
<article class="post">
<div class="img-wrapper"><?php the_post_thumbnail(); ?></div>
@Lysindr
Lysindr / Task.js
Created September 22, 2016 22:00
Task for work JS
function makeFactorial(n) {
var result = 1;
for(var i = 1; i <= n; i++) {
result = result * i;
}
return result;
};
fucntion checkAge(age) {
if (age > 18) {
return true;
else {
return confirm('Родители разрешили?');
}
}
};
@Lysindr
Lysindr / JS DONE
Created September 25, 2016 21:27
JS tasks-done
// TASK 1
function makeArrayXY(x, y) {
var resultArray = [];
function getRandomNumber() {
return Math.round(Math.random()*100);
}
for(var i = 0; i < x; i++) {
resultArray[i] = new Array();
@Lysindr
Lysindr / learn.javascript.ru.js
Created September 26, 2016 15:41
learn.javascript.ru
// learn.javascript.ru ***
/* ===== ARRAY =======*/
//TASK 1
// Получить последний элемент массива
var goods = ["Яблоко","Апельсин","Груша","Арбуз","Дыня"];
console.log(goods.length); // Узнаем длину массива
console.log(goods); // Выводим весь массив
@Lysindr
Lysindr / task-2.js
Last active October 4, 2016 14:20
task-2.js
//Task 1
function calcArif(arr) {
var sum;
sum = arr.reduce(function(sum, cur) {
return sum + cur;
});
return sum/arr.length;
@Lysindr
Lysindr / profile-info.html
Created October 5, 2016 19:47
Profile Page
<html>
<head>
<title>Title</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body >
<h1>Form page</h1>
<button id="modal-btn">Open Modal</button>
<div id="myModal" class="popup-login">
<form class="popup-login-form">
<span class="close">x</span>
<div class="payment-form-row">
<label class="label" for="login">Login</label>
<input class="input" id="login" type="text" placeholder="Enter Your Login">
</div>
@Lysindr
Lysindr / border-image
Created October 16, 2016 20:35
border-image
.bg {
color: #ccc;
padding: 0 40px;
// border-style: solid;
// border-width: 15px;
border-image-source: url(../images/border-img-2.png);
// border-image-slice: 20;
// border-image-repeat: fill;
border-image-slice: 13 11 13 13 fill; border-image-width: 13px 13px 13px 13px; border-image-outset: 13px 13px 13px 13px; border-image-repeat: repeat repeat;
@Lysindr
Lysindr / Юг Север
Created October 17, 2016 07:27
Юг Север
// task 8
function manReturnTime(["Юг,", "Север", "Восток", "Запад"], 90) {
var timeForStep = 10;
if (path.length * timeForStep > time) {
return false;
}
var sonthCount = 0, //создаем счетчики, которые будут считать сколько перемещений есть
northCount = 0,
westCount = 0,