Skip to content

Instantly share code, notes, and snippets.

View nedbaldessin's full-sized avatar

Ned Baldessin nedbaldessin

View GitHub Profile
@nedbaldessin
nedbaldessin / Gruntfile.js
Created June 18, 2014 09:46
Browserify with separate vendor bundle
browserify: {
libs: {
src: ['.'],
dest: 'public/assets/lib/bottom/combined/react_toolkit.js',
options: {
alias: [
'react:',
'director:',
'lodash:',
],
...
"materials": {
"selected": [
13
],
"counters": {
"11": 12,
"12": 1,
"13": 167,
"14": 2,
@nedbaldessin
nedbaldessin / in-feed-ad.html
Last active August 29, 2015 14:04
Style: new columns
...
</article> <!-- / .story-item -->
<!-- Only displayed on tablet and mobile. -->
<div class="story-item__ad ad-w300-in-story-col">
<div class="ad-w300-in-story-col__inner">
<img src="http://placehold.dev.area17.com/image/300x250" alt="placeholder">
</div>
</div>
@nedbaldessin
nedbaldessin / conditionally_load.js
Created August 8, 2014 17:09
Conditionally load HTML content based on breakpoint.
/**
* conditionally_load.js
* Replace an element with content loaded over XHR,
* if given media query conditions are met.
*/
window.Marchay.Behaviors.conditionally_load = function() {
'use strict';
var $this = $(this),
conditions = $this.data('conditions').split(' '),
win_width = $(window).width(),
diff --git a/public/assets/lib/bottom/vendor/jquery.stickem.js b/public/assets/lib/bottom/vendor/jquery.stickem.js
index 5f2c4f8..d548c0f 100644
--- a/public/assets/lib/bottom/vendor/jquery.stickem.js
+++ b/public/assets/lib/bottom/vendor/jquery.stickem.js
@@ -79,7 +79,7 @@
};
//If the element is smaller than the window
- if(_self.windowHeight > item.elemHeight) {
+ //if(_self.windowHeight > item.elemHeight) {
@mixin svg-bg-with-fallback($file_name) {
background-repeat: no-repeat;
background-image: inline-image('#{$file_name}.svg', image/svg\+xml);
html.no-svg & {
background-image: image-url('#{$file_name}.png');
}
}
try {
$("mbshows_view").replace("<div class=\"comments_zone\">\n \n <div class=\"main_col\">\n <div id=\"comments_container\">\n <div class=\"comments-login\">\n <p>\n \n You must be a member to comment on Geoff\u2019s post.\n \n </p>\n <p class=\"login\"><a href=\"/login\">Login</a> or <a href=\"/join\">register here</a></p>\n</div>\n\n \n <ul id=\"comments\" class=\"comments comments-permalink\">\n \n<li id=\"comment_5137\" class=\"comment_group_5137\">\n <div class=\"img\">\n <a href=\"/profiles/androse\"><img alt=\"Default_avatar_small\" src=\"/images/defaults/default_avatar_small.png?1271324811\" /></a>\n </div>\n <div class=\"comment\">\n <p class=\"details\">\n <a href=\"/profiles/androse\">androse</a>\n <span>about 20 hours ago</span>\n </p>\n \n <p>Vendre feum lacinia sequis illuptatie ullutis loboreet, odolore cum exercillaore del justo feuguerostin. Esectem cor dictum hendrerit. Iscing doloboreet euipit pretium. Incinis dolenim blam
@nedbaldessin
nedbaldessin / gem_make.out
Created October 24, 2012 00:06
sudo gem install mailcatcher
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... yes
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
creating Makefile
@nedbaldessin
nedbaldessin / login_and_redirect.js
Created November 14, 2012 22:41
Defered action after login (using Promises, with rsvp.js)
/**
* login_and_redirect.js
* If the user isn't logged in, open a lightbox
* and display a login form.
* When logged in, follow the link of the button (if any),
* or redirect or reload page.
*/
window.dfi_behaviors.behaviors.login_and_redirect = function() {
@nedbaldessin
nedbaldessin / application.js
Created February 7, 2013 09:02
Hooking up simple JS "behaviors" declaratively in HTML
var Example = {};
Example.Behaviors = {};
Example.loadBehaviors = function(context){
if (context) {
$context = (context instanceof window.jQuery) ? context : $(context);
} else {
$context = $(document);
}