Skip to content

Instantly share code, notes, and snippets.

Geoffrey Crofte geoffreycrofte

Block or report user

Report or block geoffreycrofte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@geoffreycrofte
geoffreycrofte / Some solutions to fix it.
Created Oct 9, 2019
How to fix Gulp Issue: gulpInst.start.apply(gulpInst, toRun); TypeError: Cannot read property 'apply' of undefined.
@geoffreycrofte
geoffreycrofte / Get-Element-By-Style.js
Last active Jan 23, 2019
Get and mark elements on a page regarding their color or any other style.
View Get-Element-By-Style.js
// 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 Nov 28, 2018
Get a count of lines of code in a Github Repository
View terminal
$ git ls-files | xargs wc -l
@geoffreycrofte
geoffreycrofte / counting-in-css.css
Last active Aug 8, 2018
A way to apply styles depending on number of elements
View counting-in-css.css
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 / child-functions.php
Created May 30, 2014
Translation for a WordPress Child Theme
View child-functions.php
<?php
/*
CHILD THEME functions.php file
*/
if ( !function_exists('child_localization')) {
function child_localization() {
load_child_theme_textdomain('child_text_domain', get_stylesheet_directory() . '/lang');
}
add_action('after_setup_theme', 'child_localization');
}
@geoffreycrofte
geoffreycrofte / functions.php
Last active Jul 6, 2016 — forked from stephanie-walter/gist:5014232
Add a Branch shortcode to WordPress
View functions.php
// 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 Sep 27, 2012
Rating with float right or direction rtl properties
View dabblet.css
/**
* 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 Sep 24, 2012
Rating with float right or direction rtl properties
View dabblet.css
/**
* 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;
View dabblet.css
/**
* "Isometric" shadow
*/
div {
position: relative;
width: 250px;
height: 200px;
background: #7799ff;
box-shadow: 10px 10px 0 #3355bb;
@geoffreycrofte
geoffreycrofte / dabblet.css
Created Sep 13, 2012
Feuilles superposées
View dabblet.css
/**
* Feuilles superposées
*/
/* Petite mise en page */
body {
width: 375px;
margin: 20px auto;
font-family: helvetica, arial, sans-serif;
color: #444;
You can’t perform that action at this time.