Skip to content

Instantly share code, notes, and snippets.

Sviatoslav SleepWalker

Block or report user

Report or block SleepWalker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@SleepWalker
SleepWalker / unregisterServiceWorkers.js
Last active Dec 10, 2018
unregister service worker
View unregisterServiceWorkers.js
// browser way
navigator.serviceWorker.getRegistrations().then(registrations => {
for (const registration of registrations) {
registration
.unregister()
.then(boolean => {
console.log(
boolean ? 'Successfully unregistered' : 'Failed to unregister',
`ServiceWorkerRegistration\n${
registration.installing
View message.md

Hello,

I've received your product. The delivery was really fast!

But it looks like something wrong with the earphones. The sound is good, but after ~5mins of usage the earphones starting to lose the signal. One after another. So frequently, that it is impossible to use them at all.

In the description is written, that it should work on standard for bluetooth distance of 10m. But in my case the distance was less than 50cm and there was already issues with connection.

I've tested earphones with my phone (bluetooth 5.0) and laptop (bluetooth 2.1). In both cases I experiencing the same problems.

View node-sass-iconfont-importer.js
var loaderUtils = require("loader-utils");
module.exports = function createImporter(options) {
return function(url, fileContext, done) {
if (options.test.test(url)) {
var request = loaderUtils.urlToRequest(url);
loaderContext.loadModule(request, function(err, source) {
if (err) return done(new Error(err));
@SleepWalker
SleepWalker / gist:08e26f5e53fb2e1d5ea8
Created Oct 24, 2015
Language codes and their translations
View gist:08e26f5e53fb2e1d5ea8
{
ar: "عربي", // Арабский
az: "Azərbaycan", // Азербайджанский
be: "Беларускі", // Беларусский
bg: "Български", // Болгарский
bs: "Bosanski", // Боснийский
ca: "Català", // Каталанский
cs: "Čeština", // Чешский
da: "Dansk", // Датский
de: "Deutsch", // Немецкий
@SleepWalker
SleepWalker / swipe.js
Created Sep 30, 2015
A simple swipe detection on vanilla js
View swipe.js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
View flexbox.less
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-moz-@{display}";
View jquery.ajax.progress.js
(function addXhrProgressEvent($) {
// Patch for progress event support
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
progress: $.noop,
xhr: function() {
var xhr = originalXhr(), that = this;
if (xhr) {
if (typeof xhr.addEventListener == "function") {
@SleepWalker
SleepWalker / собеседование_верстальщика.md
Last active Jul 1, 2019
Собеседование верстальщика
View собеседование_верстальщика.md

##Офтоп

  • Почему решили покинуть предыдущее место работы?

##Теория

  • В чем разница между inline, block, inline-block?
  • Чем отличается margin от padding?
  • Что такое overflow, когда он нужен?
  • Чем отличаются position static, absolute, relative, fixed?
  • Что вы знаете о приоритете селекторов?
  • Как браузер обрабатывает селекторы? Какие из них более производительные?
You can’t perform that action at this time.