Skip to content

Instantly share code, notes, and snippets.

View jeffreynolte's full-sized avatar

Jeffrey Nolte jeffreynolte

View GitHub Profile
@jeffreynolte
jeffreynolte / test.feature
Created October 1, 2019 18:04
Testing BDD
Scenario: Write BDD in GH
Given I setup a GH gist
When I enter the info
Then people can comment
@jeffreynolte
jeffreynolte / youtube.json
Created April 28, 2015 16:41
YouTube trend
{"date":"20150428","formattedDate":"Past 24 hours","videoList":[{"id":"tHih0KrwcgE","title":"Little Bitty Boats and Big Sharks Don\u0027t Mix | Shark Week","url":"https://www.youtube.com/watch?v\u003dtHih0KrwcgE","imgUrl":"https://i.ytimg.com/vi/tHih0KrwcgE/mqdefault.jpg","dailyViewCount":"200,000","totalViewCount":"1,364,709","commentCount":"264","username":"Discovery","length":"2:17","shareUrl":"https://www.google.com/trends/hotvideos?svt\u003dLittle+Bitty+Boats+and+Big+Sharks+Dont+Mix+%7C+Shark+Week\u0026hvd\u003d20150427\u0026geo\u003dUS#a\u003dtHih0KrwcgE","publishedTime":"8 months ago","channelUrl":"https://www.youtube.com/channel/UCqOoboPm3uhY_YXhvhmL-WA"},{"id":"7YV0EtkWyno","title":"New video shows arrest of Freddie Gray in Baltimore","url":"https://www.youtube.com/watch?v\u003d7YV0EtkWyno","imgUrl":"https://i.ytimg.com/vi/7YV0EtkWyno/mqdefault.jpg","dailyViewCount":"100,000","totalViewCount":"341,443","commentCount":"977","username":"CNN","length":"2:35","shareUrl":"https://www.google.com/trends/hot
<div class="tag" ng-repeat="cat in vm.photocats">
<h3>{{cat.name}}</h3>
<textarea name="{{cat.name}}" class="{{cat.name}}" data-cat="{{cat.name}}">
{{photo[cat.name]}}
</textarea>
</div>
@jeffreynolte
jeffreynolte / main.less
Created January 19, 2015 01:46
responsive based on height / width
.slideshow{
max-width: 60vh;
max-height: 60vh;
border: 1px solid red;
position: relative;
margin: 0 auto;
display: block;
margin-top: 20vh;
}
@jeffreynolte
jeffreynolte / browser-detect.js
Created September 16, 2014 22:17
JS Browser Detection
var detectedUA = jQuery(document).browserDetection();
var is_explorer = navigator.userAgent.indexOf('MSIE') > -1;
var is_firefox = navigator.userAgent.indexOf('Firefox') > -1;
var is_Opera = navigator.userAgent.indexOf("Presto") > -1;
var is_chrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
var is_safari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);
var is_windowsphone = /Windows Phone/.test(navigator.userAgent);
@jeffreynolte
jeffreynolte / og:wp
Created April 25, 2014 01:10
Open Graph tags for use in WordPress themes
<meta property="og:title" content="<?php wp_title(); ?>" />
<meta property="og:site_name" content="<?php wp_title(); ?>" />
<meta property="og:url" content="<?php echo get_permalink( $post->ID ); ?>" />
<meta property="og:description" content="<?php bloginfo('description'); ?>" />
<meta property="og:image" content="<?php bloginfo('template_url'); ?>/images/Untitled-6-2.png" />
<meta property="og:type" content="website" />
<!DOCTYPE html>
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<title>Breakpoint detection test</title>
<style type="text/css" media="screen">
@media screen and (min-width: 320px) {
#page:after {
content: 'smallest'; /* represent the current width-bracket */
@jeffreynolte
jeffreynolte / gform list placeholders
Created July 25, 2013 19:26
Add placeholders to all list elements in Gravity Forms.
$('.gfield_list_cell').each(function(){
var $this = $(this),
$tr = $('tr', $this.parent().parent().prev()),
i = $this.index();
$('input', $this).attr('placeholder', $('th:eq('+i+')', $tr).text());
});
#This is a template .gitignore file for git-managed WordPress projects.
# Some points pulled from https://gist.github.com/jdbartlett/444295
# Ignore everything in the root except the "wp-content" directory.
/*
!/.gitignore
!/wp-content/
# Ignore everything in the "wp-content" directory, except the "plugins"
and "themes" directories.