bonquesha99's comments

bonquesha99 | 5 months ago | on: Working pipe operator today in pure JavaScript

If you're interested in the Ruby language too, check out this PoC gem for an "operator-less" syntax for pipe operations using regular blocks/expressions like every other Ruby DSL.

https://github.com/lendinghome/pipe_operator#-pipe_operator

  "https://api.github.com/repos/ruby/ruby".pipe do
    URI.parse
    Net::HTTP.get
    JSON.parse.fetch("stargazers_count")
    yield_self { |n| "Ruby has #{n} stars" }
    Kernel.puts
  end
  #=> Ruby has 15120 stars

  [9, 64].map(&Math.pipe.sqrt)           #=> [3.0, 8.0]
  [9, 64].map(&Math.pipe.sqrt.to_i.to_s) #=> ["3", "8"]

bonquesha99 | 5 years ago | on: What every software engineer should know about Apache Kafka

As a Kafka alternative, has anyone attempted to use PostgreSQL logical replication with table partitioning for async service communication?

Proof of concept (with diagrams in the comments): https://gist.github.com/shuber/8e53d42d0de40e90edaf4fb182b59...

Services would commit messages to their own databases along with the rest of their data (with the same transactional guarantees) and then messages are "realtime" replicated (with all of its features and guarantees) to the receiving service's database where their workers (e.g. https://github.com/que-rb/que, skip locked polling, etc) are waiting to respond by inserting messages into their database to be replicated back.

Throw in a trigger to automatically acknowledge/cleanup/notify messages and I think we've got something that resembles a queue? Maybe make that same trigger match incoming messages against a "routes" table (based on message type, certain JSON schemas in the payload, etc) and write matches to the que-rb jobs table instead for some kind of distributed/replicated work queue hybrid?

I'm looking to poke holes in this concept before sinking anymore time exploring the idea. Any feedback/warnings/concerns would be much appreciated, thanks for your time!

Other discussions:

* https://old.reddit.com/r/PostgreSQL/comments/gkdp6p/logical_...

* https://dba.stackexchange.com/questions/267266/postgresql-lo...

* https://www.postgresql.org/message-id/CAM8f5Mi1Ftj%2B48PZxN1...

bonquesha99 | 6 years ago | on: Pattern Matching in Ruby 2.7 (2019)

Definitely agree regarding the strange semantics recently like the pipeline[0] or `.:` method reference[1] operators. I do think those kind of functional features would be handy if they behaved correctly and had a more Ruby-like syntax instead of introducing foreign looking operators.

Luckily this new pattern matching feature appears to behave like expected and feels pretty natural - just a new `in` keyword and some variable binding syntax to familiarize ourselves with (which we already kind of use with statements like `rescue`).

Awhile back we experimented with an alternative Ruby pipe operator proof of concept[2] that is "operator-less" and looks just like regular old Ruby blocks with method calls inside of it. Maybe there's still a chance for something like this now that those other implementations have been reverted!

  # regular inverted method calls
  JSON.parse(Net::HTTP.get(URI.parse(url)))

  # could be written left to right
  url.pipe { URI.parse; Net::HTTP.get; JSON.parse }

  # or top to bottom for even more clarity
  url.pipe do
    URI.parse
    Net::HTTP.get
    JSON.parse
  end
[0] Revert pipeline operator: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/...

[1] Revert method reference operator: https://bugs.ruby-lang.org/issues/16275

[2] Experimental "operator-less" Ruby pipe operator proof of concept: https://github.com/lendinghome/pipe_operator

bonquesha99 | 6 years ago | on: Ask HN: Who is hiring? (November 2019)

LendingHome | Offices in San Francisco and Pittsburgh | REMOTE friendly

Tech: AWS, Docker, GraphQL, JavaScript/TypeScript/Node.js, Lambda, OCR (tesseract), PostgreSQL, Python, React, Redis, Ruby on Rails

tldr: We're automating the loan origination/underwriting/servicing/investing/etc process

LendingHome is reimagining the mortgage process from the ground up by combining innovative technology with an experienced team. Our goal is to create a seamless, transparent process that transforms and automates the mortgage process from end to end. We've raised $167MM in venture capital with a team of over 300 people and have been featured on the Forbes Fintech 50 list for two years running! LendingHome is uniquely positioned to become the next great financial services brand powered by the most advanced mortgage platform in the world.

Open positions:

  * Engineering Manager
  * Senior/Staff/Principal Data Scientist
  * Senior/Staff/Principal Software Engineer
  * Design/Finance/HR/Marketing/Operations/Product/Sales/etc
Please check out our openings for more details! https://grnh.se/18ad65801

bonquesha99 | 6 years ago | on: Ask HN: Who is hiring? (October 2019)

LendingHome | Offices in San Francisco and Pittsburgh | REMOTE friendly

Tech: AWS, Docker, GraphQL, JavaScript/TypeScript/Node.js, Lambda, OCR (tesseract), PostgreSQL, Python, React, Redis, Ruby on Rails

tldr: We're automating the loan origination process (applying, underwriting, servicing, investing, etc)

LendingHome is reimagining the mortgage process from the ground up by combining innovative technology with an experienced team. Our goal is to create a seamless, transparent process that transforms and automates the mortgage process from end to end. We've raised $167MM in venture capital with a team of over 300 people and have been featured on the Forbes Fintech 50 list for two years running! LendingHome is uniquely positioned to become the next great financial services brand powered by the most advanced mortgage platform in the world.

Open positions:

  * Engineering Manager
  * Senior/Staff/Principal Data Scientist
  * Senior/Staff/Principal Software Engineer
  * Design/Finance/HR/Marketing/Operations/Product/Sales/etc
Please check out our openings for more details! https://grnh.se/18ad65801

bonquesha99 | 6 years ago | on: Ask HN: Who is hiring? (September 2019)

LendingHome | Offices in San Francisco and Pittsburgh | Remote friendly

Tech: AWS, CloudFormation, Docker, GraphQL, JavaScript/TypeScript, OCR (tesseract), PostgreSQL, Python, React, Redis, Ruby on Rails

LendingHome is reimagining the mortgage process from the ground up by combining innovative technology with an experienced team. Our goal is to create a seamless, transparent process that transforms and automates the mortgage process from end to end. We've raised $167MM in venture capital with a team of over 300 people and have been featured on the Forbes Fintech 50 list for two years running! LendingHome is uniquely positioned to become the next great financial services brand powered by the most advanced mortgage platform in the world.

Open positions:

  * Engineering Manager
  * Senior Data Scientist
  * Software Engineer (Frontend or Backend)
  * Design/Finance/HR/Marketing/Operations/Product/Sales/etc
Check out our job openings and apply at: https://grnh.se/18ad65801

bonquesha99 | 7 years ago | on: Happy Birthday, Ruby

That's what it's doing, arguments are preserved:

    # don't really know what IO.inspect is doing
    # but guessing something like this?
    def IO.inspect(value, label:)
      puts "#{label}: #{value.inspect}"
      value
    end

    value.pipe do
      IO.inspect(label: "A")
      do_something
      IO.inspect(label: "B")
      do_something_else
      IO.inspect(label: "C")
    end

bonquesha99 | 7 years ago | on: Show HN: Elixir/Unix style pipe operations in Ruby

Thanks! Agreed it feels like a good fit for Ruby as well!

RE the pattern matching stuff I think the destructuring concept could be applied to look something like:

    def div(*args)
      case args
      when Pattern{[a, 0]} then [:error, "can't divide by 0"]
      when Pattern{[a, 1]} then [:ok, Pattern.last.a]
      when Pattern{[0, b]} then [:ok, 0]
      when Pattern{[a, b]} then [:ok, Pattern.last.a / Pattern.last.b]
      end
    end

    def something(object)
      case object
      when Pattern{a[b, c]} then [:ok, Pattern.last.b + Pattern.last.c]
      else [:error, "a didn't contain b and c"]
      end
    end
Some shorthand to access `Pattern.last` e.g. "$~" for regex would make things even nicer!

bonquesha99 | 7 years ago | on: Show HN: Elixir/Unix style pipe operations in Ruby

Thanks for your feedback!

Check out this other proof of concept demonstrating ES6 style object destructuring in Ruby:

https://github.com/lendingHome/destruct

I think this same type of concept could be applied to port Elixir style pattern matching as well e.g.

    data = {
      name: "John Smith",
      age: 35,
      prefs: {
        lang: "en",
        tz: "UTC",
      }
    }
    
    User = Pattern { name age prefs[lang] }
    
    user = User =~ data
    user.name
    user.age
    user.lang
    
    [data].map(&User)
    
    case object
    when Pattern { some attrs[:nested][real][deep, fields] }
      Pattern!.some
      Pattern!.real
      Pattern!.deep
      Pattern!.fields
      Pattern!.nested #=> NoMethodError
    end
    
    # or define "locals" by defining temporary methods on
    # the block receiver when the "then" block is evaluated
    case object
    when Pattern { some nested[data] }.then do
      puts some
      puts data
    end

bonquesha99 | 10 years ago | on: Ask HN: What are you working on and why is it awesome? Please include URL

Nice, we had a similar issue which is why we decided to merge the repositories. It makes sharing code, extracting shared dependencies, and reviewing PRs so much easier when you can see changes across all projects in one diff!

You can absolutely filter the history from some directories by specifying a script to run after the repositories have been cloned. In your monolith.yml you can add something like:

  # Optional list of commands to run right after
  # all of the repositories above have been cloned.
  #
  # These are handy for things like rewriting history
  # to remove large unused files or sensitive information.
  after_clone:
    - ./remove_large_assets
Then define the `remove_large_assets` script in whatever language you want and have it run the appropriate git commands to filter that history!

After the files are filtered, the monolith repository will be generated without all that junk that was bloating your git history.

bonquesha99 | 10 years ago | on: Ask HN: What are you working on and why is it awesome? Please include URL

Misc tools to make development more efficient:

https://github.com/shuber/owners - Take ownership of your code! Knowing who owns a project or section of a code base is very helpful when asking questions or requesting feedback. This gem allows developers to define OWNERS files throughout their repository to provide a human and machine readable way to determine who the maintainers are for specific files of code.

https://github.com/shuber/monolith - Generate a monolithic repository for a set of git repositories!

https://github.com/shuber/tmux-git - Display git information in your TMUX status lines! Plays real nicely with vim-promiscuous.

https://github.com/shuber/vim-promiscuous - Instant context switching built on git and vim sessions! It basically takes a snapshot of the following and let's you rollback to previous states:

- All of your vim tabs, buffers, splits, and folds along with their sizes and positions

- The location of your cursor for each buffer

- The actively selected tab/buffer

- Your undo history (each branch's undo history is saved separately)

- Your git stage with all tracked/untracked files and staged/unstaged hunks

bonquesha99 | 15 years ago | on: Fructose: compile Ruby into PHP

Projects like these are awesome learning experiences. I've been working on something similar (rubyisms in php) but in pure php - https://github.com/shuber/phuby

  * mixins
  * classes are objects
  * eigenclasses
  * method_missing, respond_to, respond_to_missing, send, super
  * splat
  * extended, included, inherited callbacks
Definitely made me appreciate ruby more after working on it.
page 1