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
import Component from '@ember/component'; | |
export default class extends Component { | |
willDestroyElement() { | |
alert(`willDestroyElement called for ${this.item.name}`) | |
} | |
} |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
createItems() { | |
this.store.createRecord('item', {name: 'item 1'}); | |
this.store.createRecord('item', {name: 'item 2'}); | |
} | |
} |
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
require 'benchmark/ips' | |
DATA_POINTS = (1..10000).map { |i| | |
if i > 8000 # 20% | |
{ value: nil } | |
else | |
{ value: 1 } | |
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
require 'sidekiq/api' | |
Sidekiq::ScheduledSet.new.find_job("61374d5d51db323507376158") |
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 I18n | |
class << self | |
def translate_with_debug(*args) | |
puts "Translate : #{args.inspect}" | |
translate_without_debug(*args) | |
end | |
alias_method_chain :translate, :debug | |
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
# config/initializers/will_paginate.rb | |
module WillPaginate | |
module ActionView | |
def will_paginate(collection = nil, options = {}) | |
options[:renderer] ||= BootstrapLinkRenderer | |
super.try :html_safe | |
end | |
class BootstrapLinkRenderer < LinkRenderer |
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
// Create a new card | |
public void testCreateCard(){ | |
solo.clickOnButton("Login"); | |
solo.sendKey(Solo.MENU); | |
solo.clickOnText("New"); | |
solo.clickOnText("Card"); | |
solo.clickOnText("Password"); | |
solo.enterText(0, "My password"); | |
solo.enterText(1, "User"); | |
solo.enterText(2, "12345"); |