Skip to content

Instantly share code, notes, and snippets.

View dverbovyi's full-sized avatar

Dmytro Verbovyi dverbovyi

  • Ukraine, Lviv
  • 23:11 (UTC +03:00)
View GitHub Profile
@dverbovyi
dverbovyi / example.html
Last active November 21, 2017 15:30
AngularJS (v1) simple directive which fire the listener on scroll finish
<div scroll-end="loadMore()">
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@dverbovyi
dverbovyi / geo-coverter.js
Last active August 5, 2017 13:15
Determine google map circle bounds offset, convert meters to coords (lat, lng), calc max zoom level to fit in map bounds
//explanation https://en.wikipedia.org/wiki/Geographic_coordinate_system
const EARTH_RADIUS = 6378137;
const center = {
lat: YOUR_CENTER_LATIDUTE,
lng: YOUR_CENTER_LONGITUDE
};
const radianLat = YOUR_RADIUS_IN_METERS / EARTH_RADIUS;
@dverbovyi
dverbovyi / addParentSelectorForCSSRules.js
Last active August 5, 2017 13:18
adding additional parent selector to all your css rules
/**
* @method addParentSelectorForRules - adding additional class to all your css selectors
* @returns {String}
*
*
*
Example:
Before processing
"header {background-color: red}"
@dverbovyi
dverbovyi / gulpfile.js
Last active January 19, 2021 12:41
ES6 project with Gulp, Sass, Babel & Browserify
/**
* Created by Dmytro on 3/27/2016.
*/
var browserify = require('browserify'),
gulp = require('gulp'),
sourcemaps = require('gulp-sourcemaps'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer'),