Skip to content

Instantly share code, notes, and snippets.

View zoxon's full-sized avatar

Zoxon zoxon

View GitHub Profile
const scrollBarGap = window.innerWidth - document.documentElement.clientWidth

Очистка кеша браузера

Google Chrome, Chromium

Как отчистить кеш сервис воркера

  1. На странице нажать ПКМ и выбрать пункт «Просмотреть код»

Контекстное меню браузера

@zoxon
zoxon / html-time-datetime-cheatsheet.md
Created April 14, 2019 10:55
HTML <time> datetime Attribute cheatsheet

Dates:

<time datetime="1914">  <!-- means the year 1914 -->
<time datetime="1914-12">  <!-- means December 1914 -->
<time datetime="1914-12-20">  <!-- means 20 December 1914 -->
<time datetime="12-20">  <!-- means 20 December any year -->
<time datetime="1914-W15">  <!-- means week 15 of year 1914 -->

Date and Times:

youtube-dl

  1. Download playlist
$ youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" <url to playlist>
@zoxon
zoxon / App.vue
Created January 4, 2019 12:18 — forked from lmiller1990/App.vue
<template>
<div id="app">
<p>
Pending: {{ $store.state.getInfoPending }}
</p>
<p>
{{ $store.state.getInfoData }}
</p>
</div>
</template>
@zoxon
zoxon / serve.go
Created November 21, 2018 09:22 — forked from paulmach/serve.go
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
@zoxon
zoxon / pubsub.js
Created November 4, 2018 18:24 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@zoxon
zoxon / http.js
Created September 28, 2018 05:17
Axios helpers
// https://github.com/FullTimeVue/vue-rest-api-sample/blob/master/src/helpers/http.js
import axios from 'axios'
const DEFAULT_HEADERS = {
'Content-Type': 'application/json'
}
const validStatuses = [
200, 201, 202, 203, 204,
@zoxon
zoxon / bem.scss
Created September 18, 2018 10:12
BEM and SCSS (SASS)
block {
$root: &; // save parent
&__element {
color: blue;
}
&_is_active {
#{$root}__element {
color: red;