Skip to content

Instantly share code, notes, and snippets.

John Hartley johnbhartley

Block or report user

Report or block johnbhartley

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
woodwardtw / gtown_sites_vue.html
Created May 16, 2017
vue from google sheets & wp api
View gtown_sites_vue.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Georgetown Domains</title>
<script src=""></script>
<link href="" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="">
<script src=""></script>
hirejordansmith / insert-content-wordpress-after-certain-amount-paragraphs.php
Created Dec 6, 2016
Insert Content in WordPress after a certain amount of paragraphs
View insert-content-wordpress-after-certain-amount-paragraphs.php
//Insert ads after second paragraph of single post content.
add_filter( 'the_content', 'prefix_insert_post_ads' );
function prefix_insert_post_ads( $content ) {
$ad_code = '<div>Ads code goes here</div>';
if ( is_single() && ! is_admin() ) {
return prefix_insert_after_paragraph( $ad_code, 2, $content );
return $content;
edmundojr / formspree.html
Last active May 2, 2019
JS: Ajax send forms using the most excellent Formspree » #snippet
View formspree.html
<form id="contact-form" action="//" method="post">
<input type="text" name="Name" placeholder="Name" required>
<input type="email" name="Email" placeholder="Email" required>
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea>
<!-- CONFIG -->
<input class="is-hidden" type="text" name="_gotcha">
<input type="hidden" name="_subject" value="Subject">
<input type="hidden" name="_cc" value="">
<!-- /CONFIG -->
<input class="submit" type="submit" value="Send">
addyosmani /
Last active Feb 19, 2020 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

View 1-restify-server-cheatsheet.js
// Restify Server CheatSheet.
// More about the API:
// Install restify with npm install restify
// 1.1. Creating a Server.
var restify = require('restify');
joshuapaling / gist:cb683d8ec6ecab077c19
Last active Aug 29, 2015
htaccess caching, gzip compression, and blocking bots / scrapers
View gist:cb683d8ec6ecab077c19
<IfModule mod_deflate.c>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
chrisdc / navigation.js
Last active Jun 16, 2016
An alternative navigation.js that makes dropdown menus keyboard accessible in _s.
View navigation.js
* navigation.js
* Handles toggling the navigation menu for small screens and enabling tab support for dropdown menus.
( function() {
var container, button, menu, links;
container = document.getElementById( 'site-navigation' );
if ( ! container )
brodkin / magento-auth-customer-nopass
Last active May 3, 2017
Magento Force Customer Login Without Password
View magento-auth-customer-nopass
// Retrieve Customer by Email (or other method)
$customer = Mage::getModel('customer/customer')
// Set as Logged In and Clear Session
// Redirect or do something here :)
View test.js
describe('Test', function(){
before(function(done) {
client.init().url('', done);
describe('Check homepage', function(){
it('should see the correct title', function(done) {
client.getTitle(function(err, title){
expect(title).to.have.string('Example Domain');
jareware /
Last active Feb 21, 2020
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

You can’t perform that action at this time.