Skip to content

Instantly share code, notes, and snippets.

View ganapativs's full-sized avatar
🎯
Focusing

Ganapati V S ganapativs

🎯
Focusing
View GitHub Profile
@ganapativs
ganapativs / detect-private-browsing.js
Created October 26, 2016 11:05 — forked from cou929/detect-private-browsing.js
Detect private browsing mode (InPrivate Browsing or Incognito).
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@ganapativs
ganapativs / GIF-Screencast-OSX.md
Created September 28, 2016 15:20 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ganapativs
ganapativs / meta-tags.md
Created September 27, 2016 05:40 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@ganapativs
ganapativs / readme.md
Created September 27, 2016 05:39 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@ganapativs
ganapativs / svgo.json
Created September 3, 2016 09:52 — forked from bendc/svgo.json
Sketch's SVGO Compressor settings
{
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": false,
"indent": 2,
"plugins": [
{
"name": "cleanupAttrs"
},
{
"name": "cleanupEnableBackground"
@ganapativs
ganapativs / Egghead downloading.txt
Last active June 20, 2016 14:35
Egghead lessons downloading
* Download and install react developers tool from here - https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en
* Open egghead lesson's page you want to download, and open console.
* Go to react(Added by react developer tools) tab in console and inspect and search by Component Name <NextUpLessonList> and select.
* Now go to console tab and run: $r.state.list.lessons.map(function(e){console.log(e.lesson_http_url)}) to get lessons list.
* Copy list and convert it to a JS array, like
["https://egghead.io/lessons/tools-intro-to-the-production-webpack-course",
"https://egghead.io/lessons/tools-validate-your-webpack-config-with-webpack-validator",
"https://egghead.io/lessons/tools-tree-shaking-with-webpack-2",
"https://egghead.io/lessons/tools-polyfill-promises-for-webpack-2",
"https://egghead.io/lessons/tools-maintain-sane-file-sizes-with-webpack-code-splitting",
@ganapativs
ganapativs / LazyLoad.js
Created January 12, 2016 08:59 — forked from yocontra/LazyLoad.js
lazy loading react components, useful for video/audio/etc
var React = require('react');
var events = require('add-event-listener');
var isVisible = require('../isVisible');
var LazyLoad = React.createClass({
displayName: 'LazyLoad',
propTypes: {
distance: React.PropTypes.number,
component: React.PropTypes.node.isRequired,
children: React.PropTypes.node.isRequired
@ganapativs
ganapativs / Angular Watchers Counter
Last active August 29, 2015 14:27
Angular Watchers Counter
(function () {
var root = angular.element(document.getElementsByTagName('body'));
var watchers = [];
var f = function (element) {
angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) {
if (element.data() && element.data().hasOwnProperty(scopeProperty)) {
angular.forEach(element.data()[scopeProperty].$$watchers, function (watcher) {
watchers.push(watcher);