Skip to content

Instantly share code, notes, and snippets.

View geoffreycrofte's full-sized avatar
📚
Writing books

Geoffrey Crofte geoffreycrofte

📚
Writing books
View GitHub Profile

IE CSS Hacks: IE6, 7, 8, 9, 10, 11, and even Edge

I always struggle with hacks for Edge and IE. See also for other tips: http://browserhacks.com/

IE6 Only

_selector {...}
@geoffreycrofte
geoffreycrofte / Some solutions to fix it.
Created October 9, 2019 18:41
How to fix Gulp Issue: gulpInst.start.apply(gulpInst, toRun); TypeError: Cannot read property 'apply' of undefined.
npm i -g gulp-cli
@geoffreycrofte
geoffreycrofte / Get-Element-By-Style.js
Last active January 23, 2019 10:54
Get and mark elements on a page regarding their color or any other style.
// Paste that in your Browser console
let allBodyElements = document.querySelectorAll('body *'),
thePropertyName = 'color',
theExpectedValue = 'rgb(0, 82, 204)';
allBodyElements.forEach(function(el){
let style = window.getComputedStyle(el);
if ( style.getPropertyValue(thePropertyName) == theExpectedValue ) {
console.log(el);
el.style.boxShadow = '0 0 0 2px red';
@geoffreycrofte
geoffreycrofte / terminal
Created November 28, 2018 13:13
Get a count of lines of code in a Github Repository
$ git ls-files | xargs wc -l
@geoffreycrofte
geoffreycrofte / dabblet.css
Created January 28, 2012 12:36
Same effect in mouseover and mouseout
/**
*
* Same effect in mouseover and mouseout
* Different effects in : http://codepen.io/CreativeJuiz/pen/gnIJG
*
*/
div {
width: 90px; height: 90px;
margin: 3em;
@geoffreycrofte
geoffreycrofte / counting-in-css.css
Last active August 8, 2018 08:14
A way to apply styles depending on number of elements
li:only-of-type {
width: 100%;
}
/* if 2 <ul> childs */
li:nth-last-child(2):first-child,
li:nth-last-child(2):first-child ~ li {
width: 50%;
}
@geoffreycrofte
geoffreycrofte / functions.php
Last active July 6, 2016 16:20 — forked from stephanie-walter/gist:5014232
Add a Branch shortcode to WordPress
// Adds [branch id="" noscript="branch-url"] shortcode in WordPress
if ( ! function_exists( 'branch_embedded' ) ) {
function branch_embedded( $atts ) {
$atts = shortcode_atts( array( 'id' => '', noscript=> '' ), $atts );
$output = '<script type="text/javascript" src="http://embed-script.branch.com/assets/embed/embed.m.js?body=0" data-branch-embedid="' . esc_attr( $atts['id'] ) . '" ></script>';
@geoffreycrofte
geoffreycrofte / dabblet.css
Created September 27, 2012 12:00
Rating with float right or direction rtl properties
/**
* Rating with float right or direction rtl properties
*/
h1 {
text-align: center;
font-family: Helvetica, Arial;
font-weight: normal;
color: #777;
font-size: 1.3em;
clear: both;
@geoffreycrofte
geoffreycrofte / dabblet.css
Created September 24, 2012 15:10
Rating with float right or direction rtl properties
/**
* Rating with float right or direction rtl properties
*/
h1 {
text-align: center;
font-family: Helvetica, Arial;
font-weight: normal;
color: #777;
font-size: 1.3em;
clear: both;
@geoffreycrofte
geoffreycrofte / dabblet.css
Created September 13, 2012 17:15
"Isometric" shadow
/**
* "Isometric" shadow
*/
div {
position: relative;
width: 250px;
height: 200px;
background: #7799ff;
box-shadow: 10px 10px 0 #3355bb;