Skip to content

Instantly share code, notes, and snippets.

View faridv's full-sized avatar
😐
‌Dealing with challenges like this -> :|

Farid Rn faridv

😐
‌Dealing with challenges like this -> :|
View GitHub Profile
@faridv
faridv / ticker.plugin.js
Created November 11, 2018 15:21
Titles ticker plugin for jQuery
// Ticker Plugin
$.fn.fTicker = function (options) {
var $ticker = $(this);
var settings = $.extend({
// defaults.
timeout: 5000
}, options);
$.each($ticker, function () {
var $el = $(this).find("ul:first");
if ($el.find("li").length < 2)
(function takeOverConsole() {
var console = window.console;
function intercept(method) {
var original = console[method];
console[method] = function () {
var message = Array.prototype.slice.apply(arguments).join(' ');
original.call(console, arguments);
var xhr = new XMLHttpRequest();
// xhr.open('get', '/log.php?error=' + message);
@faridv
faridv / getmax.ts
Created January 27, 2020 16:40
To find the maximum y value of the objects in array:
// https://stackoverflow.com/a/4020842/893111
Math.max.apply(Math, array.map(o => o.y))