Skip to content

Instantly share code, notes, and snippets.

@evanshajed
evanshajed / bootstrap-alert-mail-check.js
Created May 3, 2012 17:34
Bootstrap JQuery Instant Mail Check Snippet
/* Bootstrap Alert snippet for JQuery Mail Check plugin.
Read More about JQuery Mail Check plugin: http://github.com/Kicksend/mailcheck/
Add mailcheck.js first before using this snippet....
*/
bootstrap_alert = function() {}
bootstrap_alert.warning = function(message) {
$('#alert_placeholder').html('<div class="alert alert-info fade in"><a class="close" data-dismiss="alert">×</a><strong>Are you typing '+message+'?</strong></div>')
@evanshajed
evanshajed / media_queries_standard_device.css
Created September 25, 2012 19:50
Media Queries for Standard Devices
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
/* Styles */
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
/*!
* JavaScript - loadGoogleMaps( version, apiKey, language )
*
* - Load Google Maps API using jQuery Deferred.
* Useful if you want to only load the Google Maps API on-demand.
* - Requires jQuery 1.5
*
* Copyright (c) 2011 Glenn Baker
* Dual licensed under the MIT and GPL licenses.
*/
@evanshajed
evanshajed / google-font-loader.js
Created January 18, 2013 15:32
JavaScript Snippets for Google Web Font Loader
/* Google Font Loader */
WebFontConfig = {
google: { families: [ 'Ubuntu+Condensed::latin' ] } //place your font name within ['...']
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
@evanshajed
evanshajed / google-font-loading-class.css
Created January 18, 2013 15:40
CSS loading classes for Google Web Fonts Loader
.wf-loading .class-name li a{ visibility: visible; }
.wf-inactive .class-name li a{ visibility: visible; }
.wf-active .class-name li a{ font-family: 'Ubuntu Condensed', sans-serif; }
/**
* PE to use SVG as CSS background image with fallback for IE8/7/6
*
* Using SVG as CSS background image to display
* resolution-independent logos or icons is pretty
* awesome but does completely fail on IE8/7/6
*
* The trick:
* All three IE versions don't support rgba color values.
* By defining a rgba background color together with the
/* Mixin for Compass - border-image
$border-image([$image-url], [$offsets], [$repeats])
Example:
@include border-image(url(../my_image.png), 10, stretch)
@include border-image(url(../my_image.png), 10 5 10 5, stretch repeat)
---------------------------------------- */
@mixin border-image($url, $offsets, $repeats) {
@evanshajed
evanshajed / sass-retina-sprite-mixin.scss
Last active December 15, 2015 12:38
SASS MIXIN for Retina Image Sprite
// SASS MIXIN for Retina Image Sprite
@mixin retina-sprite-background($name,$normal,$retina){
background-repeat: no-repeat;
background-image: sprite-url($normal);
background-position: sprite-position($normal,$name);
height:image-height(sprite-file($normal, $name));
width: image-width(sprite-file($normal, $name));
// Media Query for retina
@evanshajed
evanshajed / sass-media-breakpoint.scss
Last active December 17, 2015 11:19
@media break point in SASS for standard devices
/*
* By Shajed Evan @evanshajed
* Concept by: CHRIS COYIER @chriscoyier
// Breakpoints
@mixin breakpoint($point) {
/* Smartphones (portrait and landscape) ----------- */
@if $point == sp-portrait-lanscape {
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) { @content; }