Skip to content

Instantly share code, notes, and snippets.

View codekipple's full-sized avatar

codekipple

View GitHub Profile
@codekipple
codekipple / sass structure
Last active December 19, 2015 21:39
CSS Stratagem
- base
- functions
- mixins
- variables
- fonts
- breakpoints
- reset
- helpers
- type
@codekipple
codekipple / prefixed event
Created August 6, 2013 13:58
js function for doing cross browser event listeners
var PrefixedEvent = function(element, type, callback) {
var pfx = ["webkit", "moz", "MS", "o", ""];
for (var p = 0; p < pfx.length; p++) {
if (!pfx[p]) type = type.toLowerCase();
element.addEventListener(pfx[p]+type, callback, false);
}
}
@codekipple
codekipple / dabblet.css
Created September 4, 2013 16:17
css modal
/**
* css modal
*/
.modal {
text-align: center;
}
.modal__content {
padding: 2em;
display: inline-block;
@codekipple
codekipple / dabblet.css
Created September 4, 2013 16:28 — forked from renoirb/dabblet.css
Lea Verou's CSS Lightbox, taken on webplatform.org
/**
* Lea Verou's CSS Lightbox, taken on webplatform.org
* For redistribution purposes
* @author Lea Verou <lea@w3.org>
*/
.modal {
visibility: hidden;
position: fixed;
top: 50%;
left: 50%;
/* ------------------------------------------
PURE CSS SPEECH BUBBLES
by Nicolas Gallagher
- http://nicolasgallagher.com/pure-css-speech-bubbles/
http://nicolasgallagher.com
http://twitter.com/necolas
Created: 02 March 2010
Version: 1.2 (03 March 2011)
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
$(document).on('mouseup touchend', function(e) {
$('.my-elem').each(function() {
if($(this).has(e.target).length === 0) {
// hide this element?
}
});
});
@codekipple
codekipple / sass.js
Created August 19, 2014 14:03
programatically building a grunt tasks options
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
var config = {
options: {
includePaths: [
'<%=wpThemeDir%>/<%= wpParentThemeDir %>/sass/partials/'
]
},
@codekipple
codekipple / gist:ffbce4c9e6fa13379fc9
Created August 22, 2014 08:12
github rate limit
Authenticate with GitHub to increase your rate limit and allow you to pull from private repositories. To do that, add the following entry to your ~/.netrc file:
machine api.github.com
login <username>
password <token>
You can quickly create a new GitHub token here https://github.com/settings/tokens/new.
@codekipple
codekipple / gist:a63929d5149394092f5c
Created September 11, 2014 14:56
Hack for targeting firefox
@-moz-document url-prefix() {
select {
height: auto;
}
}
http://stackoverflow.com/questions/3123063/what-does-moz-document-url-prefix-do/3123073#3123073