This file contains hidden or 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
| # Export PATH variables | |
| export PATH="/usr/local/bin:~/.bin:$PATH" | |
| # Nicer bash defaults | |
| export PS1='\[\e[31;1m\][${LOGNAME}@\h]:\[\e[34m\]\w\[\e[0m\]>' | |
| export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi' | |
| export HISTCONTROL=erasedups # Erase duplicates | |
| export HISTSIZE=5000 # resize history size | |
| shopt -s histappend # append to bash_history if Terminal.app quits |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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', |