Skip to content

Instantly share code, notes, and snippets.

David Cochran davidcochran

Block or report user

Report or block davidcochran

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
@davidcochran
davidcochran / reveal_library.txt
Created Aug 12, 2018
Reveal the Library Folder in OS X local user directory or a backup on another volume
View reveal_library.txt
# 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/
@davidcochran
davidcochran / crypto-scraper.R
Last active Jan 10, 2018
Cryptocurrency data scraper in R -- script to utilize JesseVent/crypto
View crypto-scraper.R
# 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")
@davidcochran
davidcochran / risk_taxonomy.json
Created Jul 4, 2017
Cyber Security Risk Taxonomy
View risk_taxonomy.json
{
"name": "Threat Taxonomy",
"children": [
{
"name": "Actions of People",
"children": [
{
"name": "Inadvertent",
"children": [
{"name": "Mistakes", "size": 1},
@davidcochran
davidcochran / vs-code-turnoff-autocomplete.json
Last active Aug 24, 2019
Turn off autocompletion (intellisense) in MS Visual Studio Code
View vs-code-turnoff-autocomplete.json
// 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",
@davidcochran
davidcochran / brackets-turnoff-autocomplete.json
Last active Sep 21, 2016
Brackets Preferences: Turn off autocompletion
View brackets-turnoff-autocomplete.json
// 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": [] },
@davidcochran
davidcochran / number_formatting.py
Created Sep 19, 2016
Python - Rounding and Formatting Numbers
View number_formatting.py
## 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##
View gist:1a3b5dfc0ec750a066ee
<?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 -->
@davidcochran
davidcochran / gist:3a7c980bec460c8139a2
Created Jun 9, 2015
WP Post Excerpt -- only if an excerpt is entered
View gist:3a7c980bec460c8139a2
<?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 -->
@davidcochran
davidcochran / gist:a2f804576dbc253700fb
Created Sep 29, 2014
SVG with PNG fallback -- from Alexey Ten and CSS Tricks
View gist:a2f804576dbc253700fb
<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.
View Create-list-of-tag-names-from-classes.markdown
You can’t perform that action at this time.