Skip to content

Instantly share code, notes, and snippets.

View beardlessman's full-sized avatar

Dmitrii Mungalov beardlessman

View GitHub Profile
Удаляешь текущий
sudo apt-get purge code
Подключаем репозиторий MS
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
Устанавливаешь пакетом
@beardlessman
beardlessman / webpack.banner.js
Created April 17, 2018 04:50 — forked from kevinSuttle/webpack.banner.js
Webpack auto-injecting banner into each file
const pkg = require('./package.json');
const moment = require('moment');
const localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone
const timeStamp = moment().format('LLLL');
const banner = `
Generated on ${timeStamp} - ${localTimeZone}
Description: ${pkg.description}
Package: ${pkg.name}
Version: v${pkg.version}
Contributors: ${pkg.contributors.map(function(contributor){ return contributor})}
$(document).ready(function() {
   $("#about").click(function() {
       $('#about > .lazyload').each(function() {
           // установка src для элемента img на основании data-src
           $(this).attr('src', $(this).attr('data-src'));
       });
   });
   $("#articles").click(function() {
       $('#articles > .lazyload').each(function() {
@beardlessman
beardlessman / wp_query.php
Created March 13, 2018 09:41 — forked from akella/wp_query.php
wp query
<?php
$args = array(
'category_name' => 'news',
'posts_per_page' => 3
);
$my_query = new WP_Query( $args );
if ( $my_query->have_posts() ) {
const qsort = (arr) => {
if (arr.length < 2) {
return arr;
} else {
// Опорная точка для деления массива, выбирается случайно
const pivotPosition = Math.floor(Math.random() * arr.length);
const pivot = arr[pivotPosition];
// Значения меньшие, либо равные опорному
// попадают в новый массив less
const less = arr.filter((value, index) => {
class Person {
constructor(name) {
this.name = name;
}
kek () {
return 'lol kek';
}
}
class GreatPerson extends Person {
class Person {
constructor(name) {
this.name = name;
}
}
class GreatPerson extends Person {
constructor(name, phrase) {
super(name);
this.phrase = phrase;
@beardlessman
beardlessman / disableHandlersOnScroll.js
Created December 29, 2017 07:21
отключаем события по скроллу
var body = document.body,
timer;
window.addEventListener('scroll', function() {
clearTimeout(timer);
if (!body.classList.contains('disable-hover')) {
body.classList.add('disable-hover');
}
@beardlessman
beardlessman / hammes.js
Created December 25, 2017 06:18
options for hammerjs (fix chrome swipe bug)
options = {
touchAction: 'auto',
inputClass: Hammer.SUPPORT_POINTER_EVENTS ? Hammer.PointerEventInput : Hammer.TouchInput,
recognizers: [
[Hammer.Swipe, {
direction: Hammer.DIRECTION_HORIZONTAL
}]
]
};