Skip to content

Instantly share code, notes, and snippets.

View jenlampton's full-sized avatar

Jen Lampton jenlampton

View GitHub Profile
<NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL>
@jenlampton
jenlampton / perfect circles
Last active May 25, 2017 00:57
CSS only perfect circles?
/**
* Creates a perfectly square element with fluid width.
*
* WARNING: Do not add padding to this element.
*
* @include square_element();
*/
@mixin square_element() {
height: 0;
padding-bottom: 100%;
Backdrop.jsAC.prototype.populatePopup = function () {
var $input = $(this.input);
// Show popup.
if (this.popup) {
$(this.popup).remove();
}
this.selected = false;
this.popup = $('<div id="autocomplete"></div>')[0];
this.popup.owner = this;
<?php
/**
* @file
* Provides a token for building URL aliases for NGO articles.
*/
/**
* Implements hook_token_info().
*/
function example_token_token_info() {

Keybase proof

I hereby claim:

  • I am jenlampton on github.
  • I am jenlampton (https://keybase.io/jenlampton) on keybase.
  • I have a public key whose fingerprint is 5B4F 7ADD F457 04F3 43F7 81A1 74FB 416C 2168 43B9

To claim this, I am signing this object:

@jenlampton
jenlampton / backdrop-contrib-application.md
Last active March 10, 2016 19:52
Backdrop CMS Contributed Project Group Application

This is a proposal for the new Drupal 8 theme system. It consists of 5 Phases.

Example for terminology: For the following explanation and all examples, let's say we are working with a node of type Article.

  • hook = the name of the module or theme that is inplementing the hook (examples at bottom)
  • THEME_ID = name of the theme hook. for the node template his will be node.
  • SUGGESTION_ID = name of the template suggestion. for the node template, this will be article.

1) Definition

@jenlampton
jenlampton / gist:5650953
Last active December 17, 2015 18:09
New comment template (and variables) for Twig in D8
<article{{ attributes }}>
{{ title.prefix }}
{% if new %}
<mark class="new">{{ new }}</mark>
{% endif %}
<h3{{ title.attributes }}>{{ title.label }}</h3>
{{ title.suffix }}
<footer>
@jenlampton
jenlampton / gist:5647420
Last active December 17, 2015 17:39
New node template (and variables) for Twig in D8
<article id="node-{{ nid }}" class="clearfix {{ attributes.class }}"{{ attributes }}>
{{ title.prefix }}
{% if not page %}
<h2{{ title.attributes }}><a href="{{ url }}" rel="bookmark">{{ title.label }}</a></h2>
{% endif %}
{{ title.suffix }}
{% if display_submitted %}
<footer>