Skip to content

Instantly share code, notes, and snippets.

[02:15 PM] cohitre@baraka:~ $ cat Desktop/kjrvhbkjrvbkjvbrv.txt
The Palace of the Holy Human Excrement
test('#isOrdersRequired', function() {
var t = function(dateStr, expectedValue) {
var mp = Marketplace.create({
created_at: dateStr
});
deepEqual(mp.get("isOrdersRequired"), expectedValue, "Date %@ isOrdersRequired".fmt(dateStr));
};
t("2014-06-10T02:15:39.415520Z", false);
t("2014-11-07T00:00:00.000000Z", false);
test('search date sort has two states', function() {
var objectPath = "#search-modal .results th.date .sortable";
visit(Testing.MARKETPLACE_ROUTE)
.then(function() {
Testing.runSearch('');
stubResults();
})
.checkElements({
"#search-modal .results th.date .sortable.descending": 1
`import myAddonRouter from 'my-addon/router';`
MyAddonRoutesInitializer =
name: "myAddonRoutes"
initialize: (container, app) ->
router = container.lookupFactory("router:main")
router.map ->
myAddonRouter this
Tanga.initialize '#upsell', ->
select = $('#upsell select')
notice = $('#upsell p.notice')
// more readable checkbox selector
checkbox = $('#upsell :checkbox')
callback = ->
// Let's only check the value of $(this), easier to debug if there is more than one checkbox.
notice.toggle $(this).is(":checked")
app/helpers/templates/form_templates.haml
- define_template :labeled_text do |form, field_name, label, options|
.text-field
= form.label field_name, label
= form.text_field field_name, options
- define_template :labeled_text_area do |f, field_name, label, options|
.text-field
= form.label field_name, label
li {
padding: 0;
margin: 0;
list-style-type: none;
list-style-position: inside;
position: relative;
padding-left: 16px;
}
li:before {
class String; def pbcopy; `echo "#{self}" | pbcopy`; end; end
def require_factory_girl
gem 'factory_girl'
require 'factory_girl'
require 'spec/factories/batches'
Dir.glob('spec/factories/*.rb').each do |f|
require f
end
require 'spec/spec_helper'
end
initialize("#the-checkbox",function () {
this.change(function () {
var other = $(".other-checkboxes");
$(this).is(":checked") ?
other.attr("checked", "checked") :
other.removeAttr("checked");
})
});