Skip to content

Instantly share code, notes, and snippets.

View vinaydotblog's full-sized avatar
🏠
Working from home

Vinay Aggarwal vinaydotblog

🏠
Working from home
View GitHub Profile
/*
* @author Vinay Aggarwal
* @date 9-feb-2016
* @url https://gist.github.com/vinnizworld/af85a4c4190c3df73f33
*/
(function(){var t=window.libs,u=window.SITE_URL||"/",m=[],d={},w=function(a,e,c){if(d[a])d[a].push(e);else{if(~m.indexOf(a))return e();d[a]=[];c=document.createElement("script");c.type="text/javascript";document.head.appendChild(c);c.addEventListener("load",function(){m.push(a);d[a]&&(d[a].map(function(a){a()}),d[a]=null);e(a)});c.onerror=function(){};0===a.indexOf("http")?c.src=a:0===a.indexOf("//")?c.src=a:c.src=u+a}},p=!1;document.addEventListener("DOMContentLoaded",function(a){p=!0});window.require=
function(){var a=[],e=[],c=0,d=0,f={},g=!1,q=!1,k=!1,r=function(){g=!0;k&&h()},n=function(){q=!0},h=function(){};f.ready=function(a){p?g?h():k=!0:document.addEventListener("DOMContentLoaded",function(a){g?h():k=!0});p&&g?h():h=a;return f};f.done=function(a){g?a():r=function(){g=!0;k&&h();a()};return f};f.fail=function(a){q?a():n=function(){q=!0;a()};return f};for(c=0;c<arguments.length;c++){va
/*
* $(elems).appear(function(elem){
* console.log("Reached elment", elem);
* });
*/
$.fn.appear = function(cb) {
var w_height = $(window).height();
@vinaydotblog
vinaydotblog / url2uri.js
Created May 5, 2015 14:00
Convert a given path of image to data-uri
/*
* Usage: $('#image').prop('src', url2uri('/200.gif') );
*/
function url2uri(src, width, height) {
var img = new Image();
img.src = src;
width = width || 300;
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@vinaydotblog
vinaydotblog / designer.html
Last active August 29, 2015 14:15
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../ace-element/ace-element.html">
<polymer-element name="my-element">
@vinaydotblog
vinaydotblog / google_form_email.js
Created November 15, 2014 04:47
Send Google Form Submission to an Email address
/* Send Google Form by Email v2.1 */
/* For customization, contact the developer at amit@labnol.org */
/* Tutorial: http://www.labnol.org/?p=20884 */
function Initialize() {
var triggers = ScriptApp.getProjectTriggers();
$('#search').keyup($.debounce(function() {
// Will only execute 300ms after the last keypress.
}, 300));
#BECOME SUPER USER#
sudo -i
#add sublime to repository#
add-apt-repository ppa:webupd8team/sublime-text-2
#update#
@vinaydotblog
vinaydotblog / notify-send-bubble.html
Created October 28, 2013 07:18
Ubuntu Notify Send bubble with HTML / CSS3
<div class="notify-send">
<p><b>Title</b><br>Here is my message</p>