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
# ERB: | |
# | |
# <%= google_analytics 'UA-XXXXXXXX-X' %> | |
# </head> | |
# | |
# Haml: | |
# | |
# = google_analytics('UA-XXXXXXXX-X') | |
# %body | |
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
# ERB: | |
# | |
# <%= reformal_widget 'alma-by' %> | |
# </head> | |
# | |
# Haml: | |
# | |
# = reformal_widget('alma-by') | |
# %body | |
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
# See http://twitter.github.com/bootstrap/components.html#alerts | |
# | |
# USAGE: | |
# flash.now[:info] = { title: 'New flash messages! ', body: 'Just add :info, :success, :warning or :error.' } | |
# redirect_to root_path, warning: 'You should use :success and :error instead of :notice and :alert' | |
# | |
# in application_controller.rb | |
def pretty_flash(name, msg) | |
msg_content = if msg.is_a?(String) |
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
# Russian. Updated 2014-04-01 | |
ru: | |
admin: | |
js: | |
true: 'True' | |
false: 'False' | |
is_present: 'Не пустое' | |
is_blank: 'Пустое' | |
date: 'Дата ...' |
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
get '/fundref' | |
get '/fundref.csv' | |
get '/chorus' | |
get '/funders/:id/dois' | |
get '/funders/:id/hierarchy' | |
get '/funders/:id/hierarchy.csv' | |
get '/funders/hierarchy' | |
get '/funders/dois' | |
get '/funders/prefixes' | |
get '/funders/:id' |
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
// response from http://search.chorusaccess.org/funders/100000015/dois (cr-search app) | |
{ | |
"totalResults": 8906, | |
"startIndex": 0, | |
"itemsPerPage": 20, | |
"query": { | |
"searchTerms": "100000015", | |
"startPage": 1 | |
}, | |
"items": [ |
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
// aligned/shortened/restructures response from http://api.crossref.org/funders/100000015 | |
{ | |
"status":"ok", | |
"message-type":"work-list", | |
"message-version":"1.0.0", | |
"message": { | |
"total-results":9332, | |
"query":{"search-terms":null,"start-index":0}, | |
"items-per-page":20, | |
"items": [ |
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
cr-search field -> api.crossref.org field | |
totalResults -> "message": { "total-results" | |
startIndex -> "message": { "query": {"start-index":0 | |
itemsPerPage -> "message": { "items-per-page":20 | |
"query": { "searchTerms": -> "message": { "query": {"search-terms": | |
"items": [{ "doi": -> "message": { "items": [ "DOI" | |
"items": [{ "deposited": -> "message": { "items": [ "deposited": {"date-parts": | |
"items": [{ "published": -> "message": { "items": [ "issued": {"date-parts": |
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
{ | |
"ensure_newline_at_eof_on_save": true, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": true | |
} |
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
Benchmark.ips do |x| | |
x.report('object comparison') { item.user == print.user } | |
x.report('id comparison') { item.user_id == print.user_id } | |
x.compare! | |
end | |
Calculating ------------------------------------- | |
object comparison 1.204k i/100ms | |
id comparison 1.972k i/100ms | |
------------------------------------------------- |
OlderNewer