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 / 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 / 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: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 / 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 / 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 / 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 / risk_taxonomy.json
Created July 4, 2017 20:31
Cyber Security Risk Taxonomy
{
"name": "Threat Taxonomy",
"children": [
{
"name": "Actions of People",
"children": [
{
"name": "Inadvertent",
"children": [
{"name": "Mistakes", "size": 1},
@data-enhanced
data-enhanced / crypto-scraper.R
Last active January 10, 2018 14:13
Cryptocurrency data scraper in R -- script to utilize JesseVent/crypto
# Install and use crypto scraper from
# https://github.com/JesseVent/crypto
# This script is written to be used by running the desired line(s) separately, often one line at a time
# Install jessevent/crypto package in Rstudio
# If you do not have devtools installed, install devtools first
install.packages("devtools")
# Now install jessevent/crypto
devtools::install_github("jessevent/crypto")
@data-enhanced
data-enhanced / reveal_library.txt
Created August 12, 2018 23:31
Reveal the Library Folder in OS X local user directory or a backup on another volume
# Using Mac OS X Terminal
# High Sierra
# August 2018
# Reveal Library folder in current user directory
chflags nohidden ~/Library/
# Reveal Library folder in backup user directory
chflags nohidden /Volumes/Volume_Name/Users/username/Library/