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
module BinarySearchTree | |
class Node | |
include Comparable | |
attr_reader :value | |
attr_accessor :left, :right, :nodes_tracker | |
def initialize(value) | |
@value = value | |
self.nodes_tracker = [] |
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
<%= | |
f.input :contributor_group, as: :contributor_group_type, | |
wrapper_html: { class: 'multi_value' }, | |
input_html: { class: 'form-control', multiple: true }, | |
include_blank: true, | |
required: f.object.required?(key) | |
%> |
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
<%= presenter.attribute_to_html(:formatted_creator, render_as: :faceted) %> |
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
<%= presenter.attribute_to_html(:creator, render_as: :creator) %> |
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
<%= f.input key, | |
as: :multi_value, | |
input_html: { | |
class: 'form-control', | |
id: 'ubiquity-funder', | |
data: { 'autocomplete-url' => "/authorities/search/local/funder", | |
'autocomplete' => key } | |
}, | |
required: f.object.required?(key) %> |
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
#send a message between two users. This will create a Mailoxer::Conversation behind the scene. | |
user_1 = User.where(email: 'user email').first | |
user_2 = User.where(email: 'user email').first | |
message_subject = "Review of work" | |
message_body = "Kindly look at my submitted work" | |
user_1.send_message(user_2, message_body , message_subject) | |
#starting Mail_boxer::Conversation | |
a = Mailboxer::Conversation.find(1) | |
yy = a.mesages |
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
sudo vim /etc/sudoers | |
https://docs.google.com/document/d/1cXS-hQ09_AXATTjcvpKqzrqVEwATsZHY9t2VfTkxRYg/edit#heading=h.wxbnbz4dhgpy | |
https://www.digitalocean.com/community/tutorials/how-to-install-software-on-kubernetes-clusters-with-the-helm-package-manager | |
https://docs.helm.sh/using_helm/#quickstart-guide | |
helm installed into /usr/local/bin/helm | |
tiller installed into /usr/local/bin/tiller | |
Run 'helm init' to configure helm. |
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
# PostgreSQL. Versions 9.1 and up are supported. | |
# | |
# Install the pg driver: | |
# gem install pg | |
# On OS X with Homebrew: | |
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config | |
# On OS X with MacPorts: | |
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
# On Windows: | |
# gem install pg |
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
#app/services/ubiquity/add_file.rb | |
#this works as it is called whilr creating hte file, however all efforts to set the file_size field failed | |
module Ubiquity | |
module AddFile | |
#private | |
=begin | |
def attach_attributes(file) | |
puts "lagos" | |
::Ubiquity::DetermineFileSize.call(file) |