Skip to content

Instantly share code, notes, and snippets.

View mixonic's full-sized avatar

Matthew Beale mixonic

View GitHub Profile
@mixonic
mixonic / gist:2356631
Created April 11, 2012 03:15
Nice nav & scrolling
$ () ->
scrolls = $('.scroll')
if scrolls.length
scrolls.click (e) ->
href = $(this).attr('href')
fragments = href.split('#')
if fragments.length > 1 && fragments[0] == "#{window.location}".split('#')[0]
e.preventDefault()
$('html,body').animate({scrollTop: $("a[name=#{fragments[fragments.length-1]}]").offset().top}, {duration: 'fast', complete: () ->
window.location = href
class Task
after_save :nofity_for_next_tasks
def notify!
unless user_notified? # This is a new column
send_actual_email_somehow(task, user)
update_attribute(:user_notified, true)
end
end
class Candidate
def this_is_instance_method
end
def self.this_is_class_method
end
class << self
(function() {
window.DS = Ember.Namespace.create({
CURRENT_API_REVISION: 4
});
})();
(function() {
MyApp.CarTextField = Ember.View.(create || expand)(function(){
valueBinding: 'car' // Because you passed car in like an argument
beep: function(){
// Beep!
}.observes('car.isMazda')
});
<form>
{{#if displayingErrors}}
<div id="error_explanation" class="clearfix">
<h5>An error stopped your settings from being saved:</h5>
<ul>
{{#each content.errors}}
<li>{{ this }}</li>
{{/each}}
</ul>
@function mycompact($one, $two, $three, $four, $five, $six, $seven, $eight, $nine, $ten) {
$originalList: $one, $two, $three, $four, $five, $six, $seven, $eight, $nine, $ten;
$compactList: ();
@each $item in $one, $two, $three, $four, $five, $six, $seven, $eight, $nine, $ten {
@if $item != false {
append $compactList, $item;
}
}
@return( $compactList );
}
Host gitolite-admin-account
HostName localhost
User matthewbeale
Port 22
IdentityFile ~/.ssh/matthewbeale
$ depdep deploy
-- Before Deployment --
REV 23d23f2f23f23f2
Last deploy by Iago <iago@othello-corp.com> at 2011-12-03 13:42:34
Deployment is not locked
-- Deploying Site --
Local REV is 12312412412412
Running predeploy hooks...
Locking for deployment...
(function() {
window.DS = Ember.Namespace.create({
CURRENT_API_REVISION: 10
});
})();
(function() {