Skip to content

Instantly share code, notes, and snippets.

View nedbaldessin's full-sized avatar

Ned Baldessin nedbaldessin

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nedbaldessin on github.
  • I am nedb (https://keybase.io/nedb) on keybase.
  • I have a public key whose fingerprint is 7025 752F 98C9 34EF E665 85C3 A155 CE05 79FC B54E

To claim this, I am signing this object:

@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');
}
}
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) {
@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(),
@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>
...
"materials": {
"selected": [
13
],
"counters": {
"11": 12,
"12": 1,
"13": 167,
"14": 2,
@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:',
],
@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);
}
@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 / 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