Skip to content

Instantly share code, notes, and snippets.

View ghankerson's full-sized avatar

Geoff Hankerson ghankerson

  • American Public Media
View GitHub Profile
{
"type": "object",
"properties": {
"Marketplace": {
"id": "Marketplace",
"type": "object",
"properties": {
"title": {
"type": "string",
"default": "Marketplace"
/* Initialize Google Publisher Tags API - Docs: http://goo.gl/ZqOiy */
var gptadslots = [];
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
@ghankerson
ghankerson / gist:95643aa70e822a0d6393
Created February 13, 2015 19:35
settings.local.php
<?php
// Database.
$databases['default']['default'] = array(
'database' => 'mp',
'username' => 'root',
'password' => '',
'host' => 'localhost',
'driver' => 'mysql',
'port' => 3306,
'prefix' => '',
<!DOCTYPE html>
<!--[if IEMobile 7]><html class="ie iem7" lang="en" dir="ltr"><![endif]-->
<!--[if lte IE 6]><html class="ie lt-ie9 lt-ie8 lt-ie7" lang="en" dir="ltr"><![endif]-->
<!--[if (IE 7)&(!IEMobile)]><html class="ie lt-ie9 lt-ie8" lang="en" dir="ltr"><![endif]-->
<!--[if IE 8]><html class="ie lt-ie9" lang="en" dir="ltr"><![endif]-->
<!--[if IE 9]><html class="ie ie9" lang="en" dir="ltr"><![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)]><!--><html lang="en" dir="ltr" prefix="content: http://purl.org/rss/1.0/modules/content/ dc: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/ og: http://ogp.me/ns# rdfs: http://www.w3.org/2000/01/rdf-schema# sioc: http://rdfs.org/sioc/ns# sioct: http://rdfs.org/sioc/types# skos: http://www.w3.org/2004/02/skos/core# xsd: http://www.w3.org/2001/XMLSchema#"><!--<![endif]-->
<head profile="http://www.w3.org/1999/xhtml/vocab">
<meta charset="utf-8" />
<%= form_for(@organization) do |f| %>
<% if @organization.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@organization.errors.count, "error") %> prohibited this organization from being saved:</h2>
<ul>
<% @organization.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
@ghankerson
ghankerson / gist:f9b885d783f57f2f65d9
Created December 9, 2014 18:19
GPT Tags take 100 bazillion
/* Initialize Google Publisher Tags API - Docs: http://goo.gl/ZqOiy */
var gptadslots = [];
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
/* Initialize Google Publisher Tags API - Docs: http://goo.gl/ZqOiy */
var gptadslots = [];
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
/* ==========================================================================
These rules only target membership ads
========================================================================== */
#membership-ad-frame-wrapper.has-ad {
position: relative;
padding-top: 16%;
}
@media only screen and (min-width: 22.5625em) { //361px
#frame-wrapper.has-ad {
class Parent
include Mongoid::Document
field :name, type: String
field :url, type: String
field :email, type: String
field :phone, type: String
field :address, type: String
field :donate_url, type: String
field :twitter, type: String
field :facebook, type: String
<?php
require 'vendor/autoload.php';
$client = new Elasticsearch\Client();
function feedQuery($count = false, $start = 0, $max = 100) {
$q = new \EntityFieldQuery();
$q->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'story')