Skip to content

Instantly share code, notes, and snippets.

@dahfazz
dahfazz / scroll.directive.ts
Created April 10, 2018 15:41
angular scroll directive
import { Observable } from 'rxjs/Rx';
import { Directive, Output, ElementRef, EventEmitter } from '@angular/core';
@Directive({
// tslint:disable-next-line:directive-selector
selector: '[demainScroll]'
})
export class ScrollDirective {
private page = 0;
@dahfazz
dahfazz / geo.js
Created August 9, 2016 05:54 — forked from mkhatib/geo.js
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
@dahfazz
dahfazz / cbGld.markdown
Created October 27, 2014 14:11
A Pen by faz.