This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Helper classes | |
$.fn.changeClass = function(className, add) { | |
add = add || false; | |
return this.each(function() { | |
if(add) { | |
$(this).addClass(className); | |
} | |
else { | |
$(this).removeClass(className); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.toggler').bind('change', function() { | |
var showIt = !$(this).is(':checked'); | |
var panel = $(this).closest('.field').nextAll('.hide'); | |
panel.changeVisibility(showIt) | |
.closest('fieldset').changeClass('featured', showIt); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html "⌘"> | |
<html> | |
<meta charset=utf-8> | |
<title>Brap.</title> | |
<style> | |
* { margin: 0; padding: 0; } | |
/** etc **/ | |
</style> | |
<body> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function basic_auth (req, res, next) { | |
if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) { | |
// fetch login and password | |
if (new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString() == 'usernamehere123:passwordhere123') { | |
next(); | |
return; | |
} | |
} | |
console.log('Unable to authenticate user'); | |
console.log(req.headers.authorization); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.ac '! git add -A && git commit -m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.class { | |
background: rgba(255,255,255,0.8); | |
html.no-rgba & { | |
background: #eee; | |
} | |
} | |
/** Which would output as: **/ | |
.class { background: rgba(255,255,255,0.8); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.transition (@property: all, @duration: 0.6s, @delay: 0s) { | |
-webkit-transition: @property @duration ease @delay; | |
-moz-transition: @property @duration ease @delay; | |
-ms-transition: @property @duration ease @delay; | |
-o-transition: @property @duration ease @delay; | |
transition: @property @duration ease @delay; | |
} | |
/* Long-hand for overriding properties */ | |
.transition-property (@property) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form { | |
&.filtered { | |
opacity: 0.5; | |
} | |
// ---- | |
.field { | |
float: left; | |
&.selected { | |
background: yellow; | |
// --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tabs | |
@mixin round-out-tab($active_class: current, $radius: 8px, $tab_color: $purple, $outer_color: #fff) { | |
position: relative; | |
a { | |
@extend .btn; | |
} | |
&.#{$active_class} { | |
&:before, | |
&:after { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Don't forget to include AddThis. | |
// It's actually really good now so you should be using it. | |
$images = [ ]; // Or wherever your hidden images are. | |
// Show images temporarily if sharing to Pinterest | |
// (Because Pinterest won't see the backgrounds.) | |
if(typeof addthis !== 'undefined') { | |
addthis.addEventListener('addthis.menu.share', function(e) { | |
if (e.type == 'addthis.menu.share' && e.data.service === "pinterest_share") { |