Skip to content

Instantly share code, notes, and snippets.

View amitabhaghosh197's full-sized avatar

amitabha ghosh amitabhaghosh197

View GitHub Profile
@amitabhaghosh197
amitabhaghosh197 / 1. Example.scss
Last active September 9, 2017 15:11 — forked from Integralist/1. Example.scss
Sass Mixin for CSS3 Animations #sass
@include keyframe(fadeout) {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@amitabhaghosh197
amitabhaghosh197 / css-calc.css
Last active September 9, 2017 15:14 — forked from jonkemp/css-calc.css
Cross Browser CSS Calc() #css
/* 1. write it out for older browsers */
/* 2. use the vendor prefix for webkit */
/* 3. use the vendor prefix for moz */
/* 4. include the un-prefixed version last */
#foo {
width: 200px;
width: -webkit-calc(50% - 100px);
width: -moz-calc(50% - 100px);
width: calc(50% - 100px);
@amitabhaghosh197
amitabhaghosh197 / high-dpi-media.css
Last active September 9, 2017 15:15 — forked from wylieconlon/high-dpi-media.css
A CSS media query that captures almost all high DPI aware devices. #css #sass #print-css
/* -------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs with IE zoomed in */
/* - Android hdpi devices and above */
/* - Android tvdpi devices, including Google Nexus 7 */
@amitabhaghosh197
amitabhaghosh197 / shortcodes-remove-p-tag.php
Last active September 9, 2017 15:15 — forked from bitfade/gist:4555047
WordPress - Remove empty p tags for custom shortcodes #wordpress #wordpress-shortcodes
// Remove all P tags from shortcodes
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
@amitabhaghosh197
amitabhaghosh197 / jss-script.js
Last active September 9, 2017 15:39 — forked from anandkumar/jss-script.js
Add 100px offset to jQuery smooth scroll Plugin #jquery #smooth-scroll
/* Smooth Back to Top, Get This functionality from: http://wordpress.org/extend/plugins/cudazi-scroll-to-top/ */
jQuery.noConflict();
jQuery(function($) {
// When to show the scroll link
// higher number = scroll link appears further down the page
var upperLimit = 100;
// Our scroll link element
@amitabhaghosh197
amitabhaghosh197 / jquery-image-resize.js
Last active September 9, 2017 15:41 — forked from ericjuden/jquery-image-resize.js
JQuery Image Resize #jquery #image-resize
$(document).ready(function() {
$('.story-small img').each(function() {
var maxWidth = 100; // Max width for the image
var maxHeight = 100; // Max height for the image
var ratio = 0; // Used for aspect ratio
var width = $(this).width(); // Current image width
var height = $(this).height(); // Current image height
// Check if the current width is larger than the max
if(width > maxWidth){
@amitabhaghosh197
amitabhaghosh197 / q.md
Last active September 9, 2017 15:44 — forked from SinisterMinister/q.md
JS Interview questions #javascript

Javascript Interview Questions

General interview questions for a front-end JS developer.

Questions

  • What is the spec Javascript implements and what versions of it are you most current with?

  • Does JavaScript support the use of classes?

jQuery plugin: .deepest()

Get the deepest descendants matching an optional selector of each element in the set of matched elements.

A Pen by Gerald on CodePen.

License.

Installation