Skip to content

Instantly share code, notes, and snippets.

View afryer's full-sized avatar

Anthony afryer

  • Between a rock and a hard place
View GitHub Profile
@afryer
afryer / _mixins.scss
Created May 16, 2013 22:59
_mixins base
// Mixins ======================================================================================== /
@mixin clearfix { // micro clearfix hack
zoom: 1;
&:before, &:after { content: ""; display: table; }
&:after { clear: both; }
}
@mixin border-box { // border-box mixin
-webkit-box-sizing: border-box;
@afryer
afryer / gist:5598835
Created May 17, 2013 12:54
Sublime Text Snippet keyboard sass comment
[
{ "keys": ["ctrl+shift+b"], "command": "insert_snippet", "args": {"contents": "${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} = ${1:Banner} =${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}"}}
]
@afryer
afryer / gruntfile.js
Created May 22, 2013 06:29
grunt boilerplate
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
dev: {
options: {
@afryer
afryer / gist:5643974
Created May 24, 2013 14:37
Sublime Text keyword bindings
[
{ "keys": ["ctrl+shift+b"], "command": "insert_snippet", "args": {"contents": "${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} = ${1:Banner} =${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}"}},
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}, "context":
[
@afryer
afryer / Default (Windows).sublime-keymap
Created May 28, 2013 08:27
user added shortcuts sublime text 2
[
{ "keys": ["ctrl+shift+b"], "command": "insert_snippet", "args": {"contents": "${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} = ${1:Banner} =${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}"}},
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}, "context":
[
@afryer
afryer / _pems.scss
Created May 31, 2013 20:38 — forked from mrdanadams/_pems.scss
Px to ems
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */
/* Default font size in pixels if not overridden. */
$baseFontSize: 16;
/* Convert PX units to EMs.
Ex: margin-right: pem(16);
*/
@function pem($pxval, $base: $baseFontSize) {
@return #{$pxval / $base}em;
@afryer
afryer / gist:5806844
Created June 18, 2013 16:22
jquery v1.10.1
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script>
@afryer
afryer / gist:5815468
Created June 19, 2013 15:57
tiny custom selects
<script type="text/javascript">
$('select').each(function () {
var title = this.options[this.selectedIndex].text;
$(this).css({ opacity: '0', zIndex: '9999' });
$(this).after('<span class="select">' + title + '</span>');
});
$('select').change(function () {
var getvalue = this.value;
var title = this.options[this.selectedIndex].text;
// private method
// Wraps the HTML in a TAG, Tag is optional
// If the html starts with a Tag, it will wrap the context in that tag.
// doesn't ACTUALLY work
function wrap(xhtml, tag) {
// new approach
// createDocumentFragment
var docFrag = document.createDocumentFragment(),
dummy,
wrapTag;