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
module Arel | |
module Predications | |
def tz_offset(offset) | |
Nodes::InfixOperation.new('AT TIME ZONE INTERVAL', self, offset) | |
end | |
end | |
end |
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
/*** | |
* Example: | |
* | |
* <span ui-image | |
* load-image="true" | |
* srcset="[ | |
* [image.large_mobile, '650w 1x'], | |
* [image.large_mobile_2x, '650w 2x'], | |
* [image.large, '1x'], | |
* [image.large_2x, '2x'] |
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
### | |
# Example: | |
# | |
# module ProductImageHelper | |
# def product_image_tag(product, options={}) | |
# image = product.images.first.attachment | |
# | |
# image_queries = [ | |
# { | |
# src: image.url(:large_mobile_2x), |
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
### | |
# <%= ember_template 'greeting' do %> | |
# Hello {{name}}! | |
# <% end %> | |
### | |
module EmberHelper | |
include ActionView::Helpers::CaptureHelper | |
def ember_template(name, &block) |
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
# curl -L https://gist.github.com/danmartens/7365748/raw/give-up.sh | sh | |
# Please make sure Xcode is up to date and you've agreed to the license! | |
echo_purple(){ | |
echo "\n\033[45m$1\033[0m\n" | |
} | |
clear |
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
Ember.Handlebars.registerBoundHelper 'pluralize', (number, singular, plural) -> | |
unless Ember.typeOf(plural) is 'string' | |
plural = "#{singular}s" | |
return if number is 1 then singular else plural |
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
(($) -> | |
pluginName = 'pluginName' | |
defaults = { | |
prop: 'value' | |
} | |
class Plugin | |
constructor: (element, options) -> | |
@el = element; @$el = $(element) |
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
c() { cd ~/Projects/$1; } | |
_c() { _files -W ~/Projects -/; } | |
compdef _c c | |
alias c='nocorrect c' |
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
# Example: | |
# | |
# it "should alert me" do | |
# stub_browser_alert | |
# | |
# visit "/" | |
# | |
# wait_until { browser_alert_messages.count > 0 } | |
# | |
# browser_alert_messages.last.should eq("Hello World!") |
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
/* | |
* Example: | |
* | |
* ListView = Backbone.CollectionView.extend({ | |
* tagName: 'ul' | |
* itemView: Backbone.View.extend({ | |
* tagName: 'li', | |
* template: _.template('<%= item.content %>'), | |
* | |
* initialize: function() { |