Skip to content

Instantly share code, notes, and snippets.

View dmolsen's full-sized avatar

Dave Olsen dmolsen

View GitHub Profile
@dmolsen
dmolsen / header.mustache
Created February 18, 2014 16:02
An example header pattern from Pattern Lab
<!-- Begin .header -->
<header class="header cf" role="banner">
{{> atoms-logo }}
<a href="#search-form" class="nav-toggle nav-toggle-search icon-search"><span class="is-vishidden">Search</span></a>
<a href="#nav" class="nav-toggle nav-toggle-menu icon-menu"><span class="is-vishidden">Menu</span></a>
{{> molecules-primary-nav }}
{{> molecules-search }}
</header>
<!-- End .header -->
@dmolsen
dmolsen / pattern-lab-export.md
Created May 31, 2014 19:59
Exporting Patterns from Pattern Lab

Exporting Patterns from Pattern Lab for Drupal 8 Themes

I'm going to use Drupal as my guinea pig when thinking about this because Marc has shown the most interest in trying to make this happen. The holy grail does seem to be creating a way to have PL live with a remote project. Right now it's very good for the development but falls short or probably requires a lot of work if used as part of maintenance.

In order to work well for Drupal I would assume we'd have to tackle the following three problems:

  1. Develop patterns in the native format (Twig)
  2. Store or export patterns so they match the destination format (theme structure)
  3. Sync the exported patterns with a remote system
@dmolsen
dmolsen / pattern-lab-bower-components.md
Created July 14, 2014 20:41
creating bower packages with pattern lab

Earlier today @_beneverard tweeted about a common problem with managing style guides. He said:

For those who have created extensive pattern libraries, how do you go about using that CSS in a project? Manually copy it across?

I started thinking about how we could encourage this in Pattern Lab. A lot of my recent work on PL has revolved around creating packages for Composer and it seemed like this was a similar problem. After playing around I'm curious if folks would think the following process was an onerous workflow. Let's say we're going to track our styles and grunt/gulp uses public/styles/ as a target directory:

  1. Delete all files under public/styles
  2. Commit the deletion
  3. Add public/styles to .gitignore
  4. Create a new repo just for your production styles
@dmolsen
dmolsen / Google Map and jQTouch-related bindings
Created February 25, 2010 02:31
Google Map and jQTouch-related bindings
@dmolsen
dmolsen / gist:314187
Created February 25, 2010 03:11
Google Maps v3 and jQTouch
<div id="map-detail" class="notransform">
<div class="toolbar">
<h1>Map Details</h1>
<a href="#" class="back">Back</a>
</div>
<div id="map-container" class="notransform">
<div id="map-info">
<div>
$(document).ready(function() {
if ($('body').hasClass('fullscreen')) {
alert("fullscreen");
}
});
/* MAPS */
#map-info {
position: absolute;
z-index: 1000;
top: 45px;
background-color: rgb(0,0,0);
opacity: .85;
width: 100%;
padding: 8px 0px 8px 0px;
margin: 0;
$(function(){
$('#jqt').ajaxComplete(function(){
add_ga(); // add google analytics on each page load
});
$(document).ready(function() {
add_ga(); // add google analytics to the first page
});
function add_ga() {
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Private Key</key>
<string>Pr1v4t3_K3y</string>
</dict>
</plist>
<VirtualHost *:80>
ServerName m.test.edu
DocumentRoot /Users/[your_username]/Sites/MIT-Mobile-Web/web
<Directory /Users/[your_username]/Sites/MIT-Mobile-Web/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>