Skip to content

Instantly share code, notes, and snippets.

Avatar
💃

Paul Stanton Stanton

💃
View GitHub Profile
View tenon-test.md

Given the following markup:

<fieldset id="comp-1">
    <legend id="comp-1[label]">Legend One</legend>    
    <label for="dd-1" id="dd-1[label]">Day</label>
    <input id="dd-1" type="text" />
</fieldset>

<fieldset id="comp-2">
@Stanton
Stanton / SassMeister-input-HTML.html
Last active Aug 29, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<nav>
<ul class="nav">
<li class="nav__item"><a href="#" class="nav__link">The workshop</a></li><!--
--><li class="nav__item nav__item--current"><a href="#" class="nav__link">2013 schedule</a></li><!--
--><li class="nav__item"><a href="#" class="nav__link">About CSSWizardry</a></li><!--
--><li class="nav__item"><a href="#" class="nav__link">Contact</a></li>
</ul>
</nav>
@Stanton
Stanton / gist:73385d219ab27c1eee74
Created Mar 9, 2015
Add a class then remove it on animation or transition end
View gist:73385d219ab27c1eee74
// Assume .foo triggers a CSS animation, or a transition and that we wish to
// remove the .foo class when the animation completes.
//
// Useful for declarative animation class names like .shake
// on animation end
var animationEnd = 'webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationend';
$('.foo')
.addClass('bar')
@Stanton
Stanton / SassMeister-input-HTML.html
Created Jan 21, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<p class="foo">foo</p>
<p class="foo foo--bar">foo bar</p>
@Stanton
Stanton / SassMeister-input.scss
Created Nov 25, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
.block {
color: red;
&__element {
color: white;
@Stanton
Stanton / post-merge
Created Oct 22, 2014
Grunt post-merge Git hook
View post-merge
PATH="/usr/local/bin:/usr/local/share/npm/bin:$PATH"
#!/bin/sh
grunt sass:dev
@Stanton
Stanton / Asset.css
Created Nov 2, 2012
LESS noise texture mixin
View Asset.css
/**
* Adds a transparent noise texture as a background image to a given element.
* Texture strength can be controlled with @opacity parameter.
*/
.noise (@opacity: .3) {
&:before {
bottom: 0;
content: "";
left: 0;
opacity: @opacity;
View users_controller.php
<?php
class UsersController extends AppController {
var $name = 'Users';
var $scaffold = 'admin';
var $components = array('JqImgcrop');
var $helpers = array('Javascript', 'Thumbnail', 'CropImage');
function beforeFilter() {
@Stanton
Stanton / Asset.js
Created Jun 11, 2012
Get document height
View Asset.js
function getDocumentHeight() {
return Math.max(
Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
Math.max(document.body.clientHeight, document.documentElement.clientHeight)
);
}
@Stanton
Stanton / html.html
Created May 29, 2012
light on dark inset text
View html.html
text-shadow: 0px -1px 0px #666;