Skip to content

Instantly share code, notes, and snippets.

View lukeandersen's full-sized avatar
👨‍💻

Luke Andersen lukeandersen

👨‍💻
View GitHub Profile
@lukeandersen
lukeandersen / gist:ab3381ccb76d25c2196f
Last active August 29, 2015 14:04
Dynamic image galleries
// Dynamic project image galleries
$('.project-item-wrapper').click(function(e) {
e.preventDefault();
// .project-item-wrapper should have the page destination as its link src, this way is JS is disabled the user would still get to the images
var link = $(this).attr('href');
$.ajax({
url: link,
success: function( data ) {
@lukeandersen
lukeandersen / gist:df02b34353f539722db3
Created July 31, 2014 01:03
No sudo to install packages
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
sudo chown -R `whoami` /usr/local
@lukeandersen
lukeandersen / gist:11371219
Last active August 29, 2015 14:00
Stupidly simple social sharing buttons
<div class="post-share">
<a class="icon-facebook-sign" href="https://www.facebook.com/sharer/sharer.php?u={PAGE URL}"></a>
<a class="icon-twitter-sign" href="https://twitter.com/intent/tweet?url={PAGE URL}&text={PAGE TITLE}}via={SITE NAME}"></a>
<a class="icon-pinterest-sign" href="http://pinterest.com/pin/create/button/?url={PAGE URL}&media={POST IMAGE URL}&description={PAGE TITLE}" title="Pin It"></a>
<a class="icon-google-plus-sign" href="https://plus.google.com/share?url={PAGE URL}"></a>
</div>
<script>
// requires jQuery
$('.post-share a').each(function() {
@lukeandersen
lukeandersen / Bower behind firewall
Created April 4, 2014 03:03
Make bower work behind a firewall and stop getting hanging errors when scaffolding yeoman sites.
git config --global url."https://".insteadOf git://