Skip to content

Instantly share code, notes, and snippets.

<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="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
@dilrajahdan
dilrajahdan / gist:8602858
Created January 24, 2014 18:13
JS > Prefixed Methods
// Run vender prefexed method.
// Usage:
// if (prefixedMethod(document, 'FullScreen') || prefixedMethod(document, 'IsFullScreen')) {
// prefixedMethod(document, 'CancelFullScreen');
// }
// else {
// prefixedMethod(e, 'RequestFullScreen');
// }
var prefixedMethod = function (obj, method) {
@dilrajahdan
dilrajahdan / gist:8602835
Created January 24, 2014 18:12
JS > Prefexed Events
// Add vender prefexed event.
// Usage: prefixedEvent($(parent), $(element), 'AnimationEnd', changeIndex);
var prefixedEvent = function (parent, element, type, callback) {
var pfx = ['webkit', 'moz', 'MS', 'o', ''];
for (var p = 0; p < pfx.length; p += 1) {
if (!pfx[p]) {
@dilrajahdan
dilrajahdan / new_gist_file
Created September 19, 2013 22:53
Less Loop - WTF!
// From http://blog.thehippo.de/2012/04/programming/do-a-loop-with-less-css/
@iterations: 30;
// helper class, will never show up in resulting css
// will be called as long the index is above 0
.loopingClass (@index) when (@index > 0) {
// create the actual css selector, example will result in
// .myclass_30, .myclass_28, .... , .myclass_1
@dilrajahdan
dilrajahdan / jquery-equal-heights
Created July 9, 2013 22:13
Jquery Equal Height
var maxHeight = 0;
$("div").each(function(){
if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
});
$("div").height(maxHeight);
@dilrajahdan
dilrajahdan / snippet-full-width-bg
Created May 15, 2013 12:56
Full width background hack with no wrapping div
// CSS
.module{
width: 940px;
margin:auto
}
.content{
background: blue;
@dilrajahdan
dilrajahdan / sass-breakpoint-mixin
Created April 10, 2013 12:03
SASS Breakpoint Mixin
/*
Breakpoint Mixin
*/
// Vars
/* Breakpoints */
$bp-small-w : 650px;
$bp-medium-w : 1250px;
@dilrajahdan
dilrajahdan / js-skip-url-bar-on-mobile
Created March 20, 2013 12:34
Skip past URL bar on browser. Should be used on Mobile.
// Skip past URL bar on browser. Should be used on Mobile.
// http://24ways.org/2011/raising-the-bar-on-mobile/
// ========================================================
skipChrome : function(){
var win = window,
doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){
//scroll to 1
@dilrajahdan
dilrajahdan / js-equal-heights-jquery
Created March 12, 2013 12:14
Equal Heights jQuery Plugin
Equal Heights - http://andreaslagerkvist.com/jquery/equal-height/
@dilrajahdan
dilrajahdan / js-infinite-carousel
Last active December 14, 2015 19:19
Infinite Carousel adapted from Remy Shape - jQuery for Designer