Skip to content

Instantly share code, notes, and snippets.

View xto3na's full-sized avatar

Sergey Ponomarenko xto3na

  • Dnepropetrovsk, Ukraine
View GitHub Profile
@xto3na
xto3na / Git. Создание, удаление удаленной и локальной веток
Created November 14, 2015 14:31
Git. Создание, удаление удаленной и локальной веток
Надо добавить удаленную ветку, чтобы она синхронизировалась через pull/push.
Сначала надо создать удаленную ветку:
git push origin origin:refs/heads/new_branch_name
Стянуть ее
git pull origin
Посмотреть появилась ли в списке удаленных веток:
git branch -r
function threePlusOne(number) {
console.info(number);
if(number === 1 || number === 0) {
return number;
} else {
if(number%2) {
threePlusOne(number * 3 + 1);
} else {
threePlusOne(number / 2);
}
document.getElementById("selectId").selectedIndex = 2;
// or
document.querySelector('#select').value = 'neededValue';
@xto3na
xto3na / Typescript - multidimensional array initialization
Created December 22, 2016 01:33
Typescript - multidimensional array initialization
class Something {
private things: Thing[][];
constructor() {
things = [];
for(var i: number = 0; i < 10; i++) {
this.things[i] = [];
for(var j: number = 0; j< 10; j++) {
this.things[i][j] = new Thing();
@xto3na
xto3na / Ie и Edge убрать значки крестика и глаза с полей ввода
Created February 8, 2017 17:50
Ie и Edge убрать значки крестика и глаза с полей ввода
/* don't show the x for text inputs */
::-ms-clear {
width : 0;
height: 0;
}
/* don't show the eye for password inputs */
::-ms-reveal {
width : 0;
height: 0;
@xto3na
xto3na / setSameHeight.js
Created July 15, 2019 09:01
Set Same Height
export function setSameHeight(selector) { // Делает высоту всех элементов по селектору как у самого высокого
let arrayOfElements = document.querySelectorAll(selector);
let maxHeight = 0;
if(arrayOfElements.length > 0) {
for(let i = arrayOfElements.length - 1; i >= 0; i--) {
let heightOfElement = arrayOfElements[i].getBoundingClientRect().height;
if(maxHeight < heightOfElement) {
maxHeight = heightOfElement;
}
}
@xto3na
xto3na / alignmentAllHeights.js
Last active July 15, 2019 06:32
Выравнивание всех блоков по размеру
(function($){
function equalizeHeights(selector) {
var heights = new Array();
// Loop to get all element heights
$(selector).each(function() {
// Need to let sizes be whatever they want so no overflow on resize
$(this).css('height', 'auto');
@xto3na
xto3na / Drag-n-drop_slider.html
Last active February 26, 2019 11:18
Drag-n-drop_slider
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
@xto3na
xto3na / Scroll_styling.scss
Last active February 18, 2019 13:11
Scroll_Styling
.scrollable-container {
&::-webkit-scrollbar {
-webkit-appearance: none;
}
&::-webkit-scrollbar:vertical {
width: 12px;
}
&::-webkit-scrollbar:horizontal {
height: 12px;
}
@xto3na
xto3na / delete_local_branch.txt
Created February 13, 2019 14:45
Delete local branch
git branch -d branch-after-fail-merge