Skip to content

Instantly share code, notes, and snippets.

View notiv-nt's full-sized avatar

Mikhail Novikov notiv-nt

View GitHub Profile
@notiv-nt
notiv-nt / Brackets vim with dvorak
Created May 17, 2015 20:44
Brackets\www\thirdparty\CodeMirror2\keymap
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
/**
* Supported keybindings:
*
* Motion:
* h, j, k, l
* gj, gk
* e, E, w, W, b, B, ge, gE
'use strict';
function List(integer, symbols) {
var defaults = {
integer: 0,
symbols: 'abcdefghiklmnopqrstvxyz0123456789'.split('')
}
(function(arr, cache) {
var wl = window.localStorage;
var insert = function(fileContent, elem) {
var el = document.createElement(elem);
el.innerHTML = fileContent;
document.querySelector('head').appendChild(el);
};
@notiv-nt
notiv-nt / gulpfile.js
Created December 30, 2018 21:10
Gulp javascript task — browserify version
let PRODUCTION_MODE = process.argv.indexOf('--minify') !== -1;
const gulp = require('gulp');
const _ = require('gulp-load-plugins')();
const fs = require('fs');
gulp.task('javascript', () => {
const browserify = require('browserify');
const tasks = ['./source/js/index.js', 'source/js/sw.js']
@notiv-nt
notiv-nt / gulpfile.js
Created December 30, 2018 21:15
Gulp javascript task — parcel version
let PRODUCTION_MODE = process.argv.indexOf('--minify') !== -1;
const gulp = require('gulp');
const _ = require('gulp-load-plugins')();
gulp.task('javascript', () => {
const sources = ['./source/js/index.js', 'source/js/sw.js']
gulp.src(sources, { read: false })
.pipe(_.parcel({
@notiv-nt
notiv-nt / sw.js
Created May 20, 2019 21:18
Service worker font-display polyfill
self.addEventListener('fetch', function(event) {
// Polyfill
if (/https:\/\/fonts.googleapis.com\/css/.test(event.request.url)) {
return event.respondWith(fontDisplayPolyfill(event.request));
}
return event;
});
async function fontDisplayPolyfill(request) {
svg-sprite -s --symbol-sprite='sprite.svg' --symbol-dest=public/assets --shape-id-generator='icon-%s' source/icons/*.svg
@notiv-nt
notiv-nt / gulpfile.js
Last active October 21, 2019 08:49
Gulp javascript task — rollup version
const gulp = require('gulp');
gulp.task('js', async () => {
const rollup = require('rollup');
const replace = require('rollup-plugin-replace');
const postcss = require('rollup-plugin-postcss');
const resolve = require('rollup-plugin-node-resolve');
const babel = require('rollup-plugin-babel');
const { terser } = require('rollup-plugin-terser');
const commonjs = require('rollup-plugin-commonjs');
@notiv-nt
notiv-nt / index.html
Created October 11, 2019 06:49
feathersjs
yarn add @feathersjs/express @feathersjs/feathers @feathersjs/socketio
docker system prune -fa && docker volume prune -f && docker system df