Ported from Rails/Ruby.
Localization is supported: Copy the translations from here and port them to your gettext localization files.
MyApp.DistanceOfTimeHelpers.time_ago_in_words(~N[2015-03-05 21:45:00])
Ported from Rails/Ruby.
Localization is supported: Copy the translations from here and port them to your gettext localization files.
MyApp.DistanceOfTimeHelpers.time_ago_in_words(~N[2015-03-05 21:45:00])
require 'graphql/client' | |
require 'graphql/client/http' | |
module PlatformGraphqlClient | |
# Configure GraphQL endpoint using the basic HTTP network adapter. | |
HTTP = GraphQL::Client::HTTP.new('http://localhost:3001/api/graphql') do | |
# def headers(context) | |
# # Optionally set any HTTP headers | |
# { "Access-Token": "user-access-token" } | |
# end |
# load into test setup after `require 'capybara/rails'` | |
# some sources for below flags and profile settings | |
# https://stackoverflow.com/questions/43143014/chrome-is-being-controlled-by-automated-test-software/43145088 | |
# https://sqa.stackexchange.com/questions/26051/chrome-driver-2-28-chrome-is-being-controlled-by-automated-test-software-notif | |
# http://stackoverflow.com/questions/12211781/how-to-maximize-window-in-chrome-using-webdriver-python | |
# update sources for new Options object | |
# https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings | |
# https://github.com/teamcapybara/capybara/blob/master/lib/capybara/selenium/driver.rb | |
begin |
# `ERROR: Error installing nokogiri: | |
# ERROR: Failed to build gem native extension. | |
# | |
# current directory: /usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0/ext/nokogiri | |
# /usr/local/var/rbenv/versions/2.3.1/bin/ruby -r ./siteconf20170103-68488-r71c9j.rb extconf.rb --with-xml=/usr/local/Cellar/libxml2/ --use-system-libraries | |
# checking if the C compiler accepts ... yes | |
# checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no | |
# Building nokogiri using system libraries. | |
# ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed. | |
# *** extconf.rb failed *** |
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
goToElement(selector, offset, target) { | |
if (selector == null) { | |
return; | |
} | |
offset = offset != null ? offset : staticConstants.headerHeight; |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInitAttrs(options) { | |
console.log('didInitAttrs', options); | |
}, | |
didUpdateAttrs(options) { | |
console.log('didUpdateAttrs', options); | |
}, |
// tests/acceptance/foo-test.js | |
// Assert that text should be found | |
assert.hasText('Not Found'); // Error: Could not find text "Not Found" on the page | |
// Provide custom message | |
assert.hasText('Not Found', 'Expected to find "Not Found"'); // Error: Expected to find "Not Found" | |
// Find any number of elements containing the query text | |
text('Found'); // [<div>Found</div>, <input value="Found">] |
A topic that comes up quite often in Ember.js discussion forums is optional route parameters. Unfortunately for those who have this problem, there's no built-in way to achieve this functionality. But there is a very nice little hack that will emulate optional route parameters for most sitautions. The actual method is pretty simple, it just requires combining a few tricks. I'll describe the high-level deatils here, and you can find working example code below.
What's needed to pull this off:
index
route.)index
route is where you should redirect to if you have no model to provide. It's also where you end up if you go to a URL without providing the parameter. This route immediately redirects to your other sub-rstats = Sidekiq::Stats.new | |
stats.queues | |
stats.enqueued | |
stats.processed | |
stats.failed |
cat ~/.ssh/id_rsa.pub | ssh forge@yourserverIP "cat >> ~/.ssh/authorized_keys" | |
ssh 'forge@yourserverIP' | |
mkdir vips | |
cd vips | |
wget -c http://www.vips.ecs.soton.ac.uk/supported/current/vips-7.38.5.tar.gz | |
tar xzvf vips-7.38.5.tar.gz | |
cd vips-7.38.5/ |