Skip to content

Instantly share code, notes, and snippets.

View data-enhanced's full-sized avatar

David Cochran data-enhanced

View GitHub Profile
@data-enhanced
data-enhanced / vs-code-turnoff-autocomplete.json
Last active October 3, 2020 03:18
Turn off autocompletion (intellisense) in MS Visual Studio Code
// Turn off autocomplete in Visual Studio Code
// http://code.visualstudio.com/
// Add the following lines to user settings
// OPTIONAL WORD WRAPPING
// Controls if lines should wrap. The lines will wrap at min(editor.wrappingColumn, viewportWidthInColumns).
"editor.wordWrap": true,
// Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'.
"editor.wrappingIndent": "indent",
@data-enhanced
data-enhanced / brackets-turnoff-autocomplete.json
Last active September 21, 2016 01:26
Brackets Preferences: Turn off autocompletion
// Turns off autocompletion and smart indents
// Add the following lines to your user preferences json file
{
"codehint.AttrHints": false,
"codehint.CssPropHints": false,
"codehint.SpecialCharHints": false,
"codehint.TagHints": false,
"codehint.UrlCodeHints": false,
"closeBrackets": false,
"closeTags": { "whenOpening": false, "whenClosing": false, "indentTags": [] },
@data-enhanced
data-enhanced / number_formatting.py
Created September 19, 2016 15:39
Python - Rounding and Formatting Numbers
## INTEREST CALCULATOR ##
Lesson("Interest Calculator (Challenge)")
## The formula is A = P(1+r/n)**(n*t)
## Create each variable separate
## P = Principal, r = Rate %, n = times compounded per year, t = years
## find How much money you will have if you invest your college tuition, $100,000 into a investment account for 40 years earning 7% interest compounded yearly.
##CREATE HERE##
@data-enhanced
data-enhanced / gist:1a3b5dfc0ec750a066ee
Created June 9, 2015 18:37
WP excerpt remove p tags
<?php
$myExcerpt = get_the_excerpt();
$tags = array("<p>", "</p>");
$myExcerpt = str_replace($tags, "", $myExcerpt);
echo $myExcerpt;
?>
<!-- https://wordpress.org/support/topic/remove-ltpgt-tag-from-excerpt -->
@data-enhanced
data-enhanced / gist:3a7c980bec460c8139a2
Created June 9, 2015 18:11
WP Post Excerpt -- only if an excerpt is entered
<?php if ( !empty( $post->post_excerpt ) ) : // if the excerpt field is not empty
the_excerpt(); // do the excerpt
else : // if the excerpt field is empty
false; // no excerpt
endif; ?>
<!-- see: https://wordpress.org/support/topic/if-the_excerpt-is-blank -->
@data-enhanced
data-enhanced / gist:a2f804576dbc253700fb
Created September 29, 2014 15:54
SVG with PNG fallback -- from Alexey Ten and CSS Tricks
<svg width="96" height="96">
<image xlink:href="svg.svg" src="svg.png" width="96" height="96" />
</svg>
<!--
by Alexey Ten
http://lynn.ru/examples/svg/en.html
Exploits the way browsers render the image tag. Widely supported, including all major browsers.
@data-enhanced
data-enhanced / products-grid.less
Created January 1, 2014 23:03
Create a grid of product items using display: inline-table
.products-grid {
display: table;
}
.product-item {
float: none; // override default grid floating behavior
display: inline-table;
margin-right: -1em; // http://www.tylercipriani.com/2012/08/01/display-inline-block-extra-margin.html
vertical-align: top; // Safari defaults to vertical-align center
}
@data-enhanced
data-enhanced / clear-sm-bootstrap.less
Created December 24, 2013 19:55
Create a mixin .clear-sm to configure an element to clear the items above it only within a specified media query.
/*
In a situation such as this markup
where we want columns to organize themselves
into two rows at on smaller screens.
This Bootstrap 3 markup gets us most of the way there.
<div class="col-sm-4 col-md-2">
...
<div class="col-sm-4 col-md-2">
...
<div class="col-sm-4 col-md-2">
@data-enhanced
data-enhanced / jquery-scrollto-simple.js
Created December 23, 2013 13:31
Animate scroll to all page anchors within the page
// Animate scroll to all page anchors
$('[href^=#]').click(function (e) {
e.preventDefault();
var div = $(this).attr('href');
$("html, body").animate({
scrollTop: $(div).position().top
}, "slow", "swing");
});