Skip to content

Instantly share code, notes, and snippets.

View sergey-alekseev's full-sized avatar
🇺🇦
#StandWithUkraine

Sergey Alekseev sergey-alekseev

🇺🇦
#StandWithUkraine
View GitHub Profile
@sergey-alekseev
sergey-alekseev / sublime-text-settings-user
Created February 12, 2015 14:51
Sublime Text configuration. Make sure you have these lines in your Settings - User.
{
"ensure_newline_at_eof_on_save": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
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":
// 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": [
// response from http://search.chorusaccess.org/funders/100000015/dois (cr-search app)
{
"totalResults": 8906,
"startIndex": 0,
"itemsPerPage": 20,
"query": {
"searchTerms": "100000015",
"startPage": 1
},
"items": [
@sergey-alekseev
sergey-alekseev / cr-search-current-routes.rb
Created June 17, 2014 13:34
Present routes on https://github.com/sergey-alekseev/cr-search before I start working on it (except ORCID related routes)
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'
# Russian. Updated 2014-04-01
ru:
admin:
js:
true: 'True'
false: 'False'
is_present: 'Не пустое'
is_blank: 'Пустое'
date: 'Дата ...'
@sergey-alekseev
sergey-alekseev / gist:5126200
Created March 9, 2013 23:09
Rails pretty flash messages with Twitter Bootstrap
# 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)
@sergey-alekseev
sergey-alekseev / reformal_widget.rb
Created February 3, 2013 16:58
reformal.ru widget Rails helper
# ERB:
#
# <%= reformal_widget 'alma-by' %>
# </head>
#
# Haml:
#
# = reformal_widget('alma-by')
# %body
@sergey-alekseev
sergey-alekseev / ga_helper.rb
Created February 3, 2013 16:53
Google Analytics Rails helper
# ERB:
#
# <%= google_analytics 'UA-XXXXXXXX-X' %>
# </head>
#
# Haml:
#
# = google_analytics('UA-XXXXXXXX-X')
# %body