View solution.md

Error: No such file or directory - Cannot find Elasticsearch launch script from [elasticsearch] -- did you pass a correct path? When using ElasticSearch gems.

Ubuntu elasticsearch package changed, so no longer does which elasticsearch return anything, which means the gem can not find the binary.

Solution: suppy command option to ES to tell it where the binary is, either use the existing binary, mine was at /usr/shared/elasticsearch/bin/elasticsearch, or symlink the same binary to somewhere in $PATH or install a new version to $PATH.

To install a new version download and untar to somewhere in $PATH, e.g. ~/bin You can find downloads such as this one: https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.3.tar.gz

View a.rb
class MyThing
post :total, :must_be -> { |res| res > 10 }
def total
# ...
end
end
View idea.md
class MyListener
   on_event "recruitment/monthly_total_updated" do |payload|
     # ...
   end

end

broadcast("recruitment/monthly_total_updated", payload)
View ruby-metadata.md
module Meta
  def meta
    @meta ||= {}
  end
end

[String Hash Array].each { |klass| klass.include(Meta) }

name = "Kris"
View example.clj
(require '[clojure.java.jdbc :as j])
;; file
(j/execute! { :subprotocol "hsqldb" :subname "file:./db/testdb"} ["CREATE TABLE changes(id INT)"])
;; in memory
(j/execute! { :subprotocol "hsqldb" :subname "file:./db/testdb"} ["CREATE TABLE changes(id INT)"])
View clipboard.md
if(document.queryCommandSupported('copy')) {
        if(text=='') { text = ' '; } // empty inputs do not get selected

        // copy text to off-screen input
        $('#clipboard').val(text);

        // 1.) does copy empty inputs, but adds newline before content
        var range = document.createRange();
        range.selectNode(document.querySelector('#clipboard'));
View overview.md
class MyCommand
  include Wisper::Publisher

  def initialize(dependencies = {})
    @token_generator = depdendencies.fetch(:token_generator) do
       require 'generate_token'
       GenerateToken.new
     end
  end
View notifier_with_audit.md

Usecase: email notifications need storing for audit/regulatory purposes.

SendNotification will send and record a notification.

SendNotification = Oxygen::SendNotification.new(env: '', template_root: '')

SendNotification.call(recipients: [], subject: '', data: {}, template: '', sender_id: '')
View README.md

Copy paste each page (just the table) of transactions from Freeagent in to a text file. Ensure it is a plain text file. Save the text file in to the same directory as main.rb. Run the script ruby main.rb.

View keybase.md

Keybase proof

I hereby claim:

  • I am krisleech on github.
  • I am krisleech (https://keybase.io/krisleech) on keybase.
  • I have a public key ASAZreLYPIXpsQV6gtgNV7aficJb7qfNPIbSoHvOVrvWqQo

To claim this, I am signing this object: