This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG = 1 | |
module ::Guard | |
class Coffee < Guard | |
DEFAULT_OPTIONS = {compiler: 'coffee', input: 'coffee', output: 'js'} | |
def initialize(watchers = [], options = {}) | |
watchers = [] if !watchers | |
defaults = DEFAULT_OPTIONS.clone | |
if options[:input] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<article> | |
<h1 class="fixie"></h1> | |
<p> Check us out at <a class="fixie"></a>, | |
and don't forget to view source.</p> | |
<section class="fixie"> | |
<p></p> | |
<img/> | |
<ul></ul> | |
<p></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyView extends Backbone.View | |
constructor: -> | |
super | |
# Votre code .... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var marker = addresspickerMap.addresspicker( "marker"); | |
var map = addresspickerMap.addresspicker( "map"); | |
google.maps.event.addListener(marker, 'click', function() { | |
var infowindow = new google.maps.InfoWindow({content: "bla bla bla"}) | |
infowindow.open(map,marker); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LiquidHandler | |
PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template | |
_response url _request _cookies variables_added _flash params _headers request cookies | |
ignore_missing_templates flash _params logger before_filter_chain_aborted headers ) | |
def self.call(template) | |
new.compile(template) | |
end | |
def compile(template) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you dont need to call original method | |
$.widget("ui.addresspicker", $.extend({}, $.ui.addresspicker.prototype, { | |
_updatePosition: function(){ | |
// Do what you want to | |
} | |
})); | |
// If you need to call original method | |
var _updatePosition = $.ui.addresspicker.prototype._updatePosition; | |
$.widget("ui.addresspicker", $.extend({}, $.ui.addresspicker.prototype, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extend jQuery objects with Underscore collection methods. | |
# | |
# Each collection method comes in two flavors: one prefixed | |
# with _, which yields a bare DOM element, and one prefixed | |
# with $, which yields a jQuery-wrapped element. | |
# | |
# So if `this` is a jQuery object, instead of: | |
# | |
# _.max @, (el) -> $(el).height() | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
This stuff will be native in Rails 3.1 and the layout of the files on the | |
filesystem will be different but this guide will get you working with it | |
while we wait for all that to finalize. | |
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist. | |
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Acceptance test with devise signup with stub for omniauth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.SplitView = Backbone.View.extend({ | |
el: $(document.body), | |
// Delegated mouse down events | |
events: { | |
"mousedown .vsplit": "mouseDownVSplit", | |
"mousedown .hsplit": "mouseDownHSplit" | |
}, | |
initialize: function(element) { |