Skip to content

Instantly share code, notes, and snippets.

View rpearce's full-sized avatar

Robert Pearce rpearce

View GitHub Profile
@rpearce
rpearce / gist:2507078
Created April 27, 2012 07:42
SASS iteration, interpolation, mixin, function
$sections: section1, section2;
$section1-bg: #72B075;
$section2-bg: #D4968E;
@mixin border-radius($amount) {
-webkit-border-radius: $amount;
-moz-border-radius : $amount;
-o-border-radius : $amount;
-ms-border-radius : $amount;
border-radius : $amount;
@rpearce
rpearce / gist:2507086
Created April 27, 2012 07:43
SASS iteration, interpolation, mixin, function -- compiled
.section1 {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
-o-border-radius: 8px;
-ms-border-radius: 8px;
border-radius: 8px;
background: #72b075;
padding: 20px 0px 20px 20px; }
.section2 {
@rpearce
rpearce / gist:2920085
Created June 12, 2012 20:56
Sexy Facebook and Twitter icon CoffeeScript, assuming you have a sprite with the up and hover for each image type.
$(document).ready ->
$('.external-fb-link').css('opacity','0.5')
$('.external-tw-link').css('opacity','0.5')
$('.external-fb-link').live('mouseenter', ->
$(this)
.addClass('sprite-icon-facebook-fancy-png')
.removeClass('sprite-icon-facebook-fancy-up-png')
.animate
opacity: 1
,
@rpearce
rpearce / fb_click_event.js
Created September 22, 2012 17:24
AddThis Static, Provided Solution
// ...
events: {
'click .facebook-share' : 'postToFeed',
},
postToFeed: function() {
FB.init({appId: fb_app_id, status: true, cookie: true});
// calling the API ...
var obj = {
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=xa-505de6c2446fedb4"></script>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style"
addthis:url="http://starvingdeveloper.wordpress.com"
addthis:title="My custom title!"
addthis:description="Sweet! This is my default text about <%= item.get('something_interesting') %>!">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"
addthis:title="Sweet! This is my custom Twitter text about <%= item.get('something_interesting') %>!"></a>
<a class="addthis_button_linkedin"
addthis:description="Sweet! This is my custom LinkedIn text about <%= item.get('something_interesting') %>!"></a>
// ...
render: function() {
this.setMetaTags();
// ...
},
setMetaTags: function() {
var self, title, url, tags;
.facebook-share { float: left; }
.facebook-share:hover {
-khtml-opacity: 0.7;
-moz-opacity: 0.7;
opacity: 0.7;
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=(70));
}
var GeneralMixins = {
preventHref: function(e) {
e.preventDefault();
}
};
// ...
// note: the view is titled ShareLinks
// ...
events: {
// ...
events: {
'click .facebook-share' : 'postToFeed',
},
postToFeed: function() {
FB.init({appId: fb_app_id, status: true, cookie: true});
// calling the API ...
var obj = {