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
-- Reminder: Replace YOUR_DATABASE with your own database. | |
SELECT concat | |
( | |
'execute("ALTER TABLE ', | |
t1.table_name, | |
' MODIFY `', | |
t1.column_name, | |
'` ', | |
t1.column_type, | |
' CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci', |
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
SECTIONS = { | |
abuse: '34086-9', | |
accessories: '60555-0', | |
active_ingredient: '55106-9', | |
adverse_reactions: '34084-4', | |
alarms: '69761-5', | |
animal_pharmacology_and_or_toxicology: '34091-9', | |
ask_doctor: '50569-3', | |
ask_doctor_or_pharmacist: '50568-5', | |
assembly_or_installation_instructions: '60556-8', |
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
li.nav-item.dropdown | |
a.nav-link.dropdown-toggle href="#" data-toggle="dropdown" Browse | |
.dropdown-menu | |
= link_to "#{c_icon(:drugs)} Drugs".html_safe, main_app.drugs_path, class: 'dropdown-item' | |
= link_to "#{c_icon(:categories)} Categories".html_safe, main_app.categories_path, class: 'dropdown-item' | |
= link_to "#{c_icon(:pathways)} Pathways".html_safe, main_app.pathways_path, class: 'dropdown-item' | |
= link_to "#{c_icon(:reactions)} Drug Reactions".html_safe, main_app.reactions_path, class: 'dropdown-item' | |
= link_to "#{c_icon(:classifications)} Drug Classification".html_safe, main_app.classyfication_path, class: 'dropdown-item' | |
/ = link_to "#{c_icon(:targets)} Drug Targets".html_safe, main_app.targets_path, class: 'dropdown-item' |
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
namespace :update do | |
desc "Upload all Paperclip attachments to S3" | |
task s3: [:environment] do | |
models = { | |
documents: [Document, :file], | |
ms_ms_peak_assignments: [MsMsPeakAssignment, :assignment_view], | |
sops: [Sop, :file] | |
} | |
models.each do |name, (klass, attachment_method)| | |
Dir.glob("public/system/#{name}/#{attachment_method.to_s.pluralize}/**/*").reject { |f| File.directory?(f) }.each do |path| |
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
client = Elasticsearch::Client.new(log: false, host: SMPDB_ES_URL) | |
hits = [] | |
search = client.search(index: SMPDB_INDEX, scroll: '5m', body: json) | |
hits.concat(search['hits']['hits'].map { |hit| SmpdbPathway.new(Hashie::Mash.new(hit['_source'])) }) | |
# Call the `scroll` API until empty results are returned | |
while search = client.scroll(scroll_id: search['_scroll_id'], scroll: '5m') and not search['hits']['hits'].blank? do | |
hits.concat(search['hits']['hits'].map { |hit| SmpdbPathway.new(Hashie::Mash.new(hit['_source'])) }) | |
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
# Don't hide the navbar if it's collapsed i.e. we're on a phone | |
if $('.omx-site-navbar') | |
if $('.navbar-toggle').is(":visible") | |
$('.navbar').removeClass('transparent') | |
$('.navbar').addClass('visible') | |
$('.navbar-brand').show() | |
# Only toggle the navbar on the home page when it's not collapsed | |
$(window).scroll -> | |
if !$('.navbar-toggle').is(":visible") | |
# Set distance user needs to scroll before we the navbar switches |
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
# Don't hide the navbar if it's collapsed i.e. we're on a phone | |
if $('.omx-site-navbar') | |
if $('.navbar-toggle').is(":visible") | |
$('.navbar').removeClass('transparent') | |
$('.navbar').addClass('visible') | |
$('.navbar-brand').show() | |
# Only toggle the navbar on the home page when it's not collapsed | |
$(window).scroll -> | |
if !$('.navbar-toggle').is(":visible") | |
# Set distance user needs to scroll before we the navbar switches |
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
{ | |
"height": "2.3", | |
"height_unit": "m", | |
"weight": "190", | |
"weight_unit": "lbs", | |
"current_address": "9044 92 St NW, Edmonton AB Canada", | |
"occupation": "Programmer", | |
"highest_education_level": "Undergraduate", | |
"backgrounds": [ | |
"", |
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
{ | |
"auto_complete": true, | |
"auto_complete_commit_on_tab": true, | |
"auto_indent": true, | |
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme", | |
"create_window_at_startup": false, | |
"default_encoding": "UTF-8", | |
"default_line_ending": "unix", | |
"font_size": 17, | |
"highlight_line": false, |
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
brew install mariadb redis sl jq readline git wget chruby ruby-install sift gist bash-completion |
NewerOlder