Skip to content

Instantly share code, notes, and snippets.

@dieppon
dieppon / css-rules.txt
Last active March 25, 2019 12:24
List of css rules grouped with most common rules first
/* Display & Box Model */
-webkit-box-sizing: inherit;
box-sizing: inherit;
content: inherit;
display: inherit;
float: inherit;
clear: inherit;
overflow: inherit;
overflow-wrap: inherit;
overflow-x: inherit;
@dieppon
dieppon / _extra-large.scss
Created November 2, 2018 10:23
Extra breakpoint for Bootstrap 3
@include min-screen (xl) {
.container{
width: 1410px;
}
.col-xl-1,
.col-xl-2,
.col-xl-3,
.col-xl-4,
.col-xl-5,
.col-xl-6,
@dieppon
dieppon / currency_symbols.php
Last active February 13, 2023 15:46 — forked from gibbs/currency_symbols.php
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '&#1380;',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@dieppon
dieppon / functions.php
Last active January 18, 2017 11:55
Filter paragraphs and breaks on given shortcodes
<?php
function shortcode_empty_paragraph_fix( $content ) {
// define your shortcodes to filter
$shortcodes = array( 'example_shortcode_1', 'example_shortcode_2', 'example_shortcode_3' );
// array of custom shortcodes requiring the fix
$block = join("|",$shortcodes);
// opening tag
@dieppon
dieppon / _base-64.scss
Created January 16, 2015 10:15
Base64 background images mixin
@mixin background-64($code,$code-hd:null,$width:null,$height:null,$type:png) {
background-image: url('data:image/' + $type + ';base64,' + $code);
@if $code-hd == null {
} @else {
@media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) {
background-image: url('data:image/' + $type + ';base64,' + $code-hd);
-webkit-background-size: $width $height;
background-size: $width $height;
}
@dieppon
dieppon / jquery.browser.js
Last active August 29, 2015 14:03
Add classes to the HTML element based on os, browser's engine and browser client.
jQuery(document).ready(function($) {
// Add browser class to html
if (navigator.userAgent.indexOf('Mac OS X') != -1) {
// Mac
if ($.browser.opera) { $('html').addClass('opera'); }
if ($.browser.webkit) { $('html').addClass('webkit'); }
if ($.browser.mozilla) { $('html').addClass('mozilla'); }
if (/camino/.test(navigator.userAgent.toLowerCase())){ $('html').addClass('camino'); }
if (/chrome/.test(navigator.userAgent.toLowerCase())) { $('html').addClass('chrome'); }
if (navigator && navigator.platform && navigator.platform.match(/^(iPad|iPod|iPhone|iPhone Simulator|iPad Simulator)$/)) {
@dieppon
dieppon / _even-number-validator.scss
Created June 17, 2014 14:14
SASS even number validator
@function even($number) {
@return $number % 2 == 0;
}
// Sprite graphic for easy reuse
@mixin sprite-graphic($sprite-graphic-pos:null, $format: $sprite-graphic-format, $file: $sprite-graphic-file, $type: $sprite-graphic-type, $width: $sprite-graphic-width, $height: $sprite-graphic-height){
@if $format == 'hires' {
@include hires-graphic($file, $type, $width, $height);
}
@if $format == 'svg' {
@include svg-graphic($file, $type, $width, $height);
}
@if $sprite-graphic-pos == 'null' {}
@else {
@dieppon
dieppon / hires-graphic-mixin.scss
Last active August 29, 2015 14:01
Adds support for @2x background images for retina displays.
// higher resolution images for high resolution displays
@mixin hires-graphic($hdfile, $hdtype, $hdwidth, $hdheight) {
$filename: $hdfile + '.' + $hdtype;
$hdfilename: $hdfile + '@2x.' + $hdtype;
background-image: url('../images/' + $filename);
@media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) {
background-image: url('../images/' + $hdfilename) !important;
-webkit-background-size: $hdwidth $hdheight;
background-size: $hdwidth $hdheight;
}
@dieppon
dieppon / _social-colours.scss
Last active August 29, 2015 14:01
Social Network Colours
$color-blogger: #FF8833;
$color-facebook: #3B5998;
$color-flickr: #FE0883;
$color-foursquare: #0072B1;
$color-google-plus: #C63D2D;
$color-instagram: #4E433C;
$color-linkedin: #4875B4;
$color-pinterest: #910101;
$color-reddit: #CEE3F8;
$color-rss: #FA9B39;