Let's get you going as fast as possible.
First of all, download xCode from the App Store and install everything (including Command Line Tools).
Install Homebrew:
$(document).ready(function () { | |
var $el = $('element'), | |
offset = $el.offset().top, | |
class = 'your-class'; | |
$(window).on('scroll', function () { | |
if ($('body').scrollTop() >= offset) { | |
$el.addClass(class); | |
} else { | |
$el.removeClass(class); |
ping -c4 192.168.1.1 > /dev/null | |
if [$? != 0] | |
then | |
sudo /sbin/shutdown -r now | |
fi |
When working with Autoprefixer, you get used to writing prefixless SCSS.
If you discover you've been working in a Compass / Bourbon project without Autoprefixer and you can't add it, do this magical find and replace:
Find: ^(\s+)transform:(.+);
Replace: $1@include transform($2);
This will update all transform: transform1, transform2;
to @include transform(transform1, transform2);
, keeping your indentation intact.
$(document.body).on('click', 'a[href^="#"]:not(a[href="#"])', function (e) { | |
var $target = $($(this).attr('href')); | |
if ($target.length > 0) { | |
e.preventDefault(); | |
$('html, body').animate({ | |
scrollTop: $target.offset().top | |
}, 440); | |
} | |
}); |
window.validate = window.validate || {}; | |
window.validate.date = function (raw) { | |
var date, parsed; | |
date = raw.split(/[\D]+/); | |
if (date.length !== 3 || date[0].length > 2 || date[1].length > 2 || (date[2].length !== 2 && date[2].length !== 4)) { | |
return false; | |
} |
When deploying an older Lalala website (Rails 2 / Ruby 1.9.*):
gem 'platform-api', '~>0.2.0'
to your Gemfile. There's a version 0.3.0 that breaks the deploy rake task.$ bundle update
to update to the latest Lalala & the correct platform-api
version$ gem uninstall heroku
)function onTransitionEnd (callback, $element) { | |
if ('ontransitionend' in window || 'onwebkittransitionend' in window ) { | |
$element.on('transitionend', callback); | |
} else { | |
callback(); | |
} | |
} | |
onTransitionEnd(() => { console.log('hey'); }, $(document.body)); |