HNHacker News
TopNewBestAskShowJobs

bonquesha99

82 karma · joined August 3, 2009

https://github.com/shuber
submissionscomments
bonquesha99··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··on Elixir-style pipelines in Ruby
Check out this proof of concept gem to perform pipe operations in Ruby using block expressions:

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
bonquesha99··on Five lines I put in a blank .vimrc
nmap ; :
bonquesha99··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··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··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··on Ask HN: Who Wants to Be Fired?
Sometimes it's nice to step away for some perspective and start again fresh somewhere new!

People do actually read these comments so please give it a shot (even with a throwaway) just to see what's out there at least:

Ask HN: Who wants to be hired? October 2019 https://news.ycombinator.com/item?id=21126012

What do you have to lose, you want to be fired anyways!

bonquesha99··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··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··on For the Love of Pipes
Elixir/Unix style pipe operations in Ruby! https://github.com/LendingHome/pipe_operator
bonquesha99··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··on Happy Birthday, Ruby
Elixir/Unix style pipe operations in Ruby!

https://github.com/LendingHome/pipe_operator

bonquesha99··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··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··on Buttery Smooth Emacs
What are some good resources to learn more about the inner workings of text editors or building one from scratch? So far I've found and enjoyed reading/watching the resources below and would love to learn more.

* The Craft of Text Editing: https://www.finseth.com/craft/

* Writing a Text Editor From Scratch: https://www.twitch.tv/gary_bernhardt/v/90796516

* A Modern Text Editor Built in Rust: https://www.youtube.com/watch?v=SKtQgFBRUvQ

bonquesha99··on Improving Docker with Unikernels: Introducing HyperKit, VPNKit and DataKit
Wow that sounds awesome! Are there any estimates of when this will be an open beta for everyone? Very excited to try it out!

Docker ID: shuber

bonquesha99··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··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··on To Master Vim, Use It Like Language
I have a similar remapping of Caps:

  * When I tap Caps, it's `<esc>`
  * When I hold Caps OR hit it in combination with any other key, it's `<ctrl>`
It really feels like the best of both worlds. I primarily develop on OSX, so I use https://pqrs.org/osx/karabiner/ to handle the remapping.
bonquesha99··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.
bonquesha99··on Ask HN: What is your workflow for saving bookmarks?
I've been happy using Google's simple bookmarking service: http://google.com/bookmarks
bonquesha99··on GNU Social - diaspora already has a clone that's usable and free software
I bet this project wont harm you inside: http://github.com/huberry/phuby
bonquesha99··on Ask HN: What are you working on (hacking)?
That's a good idea, I'll throw a bunch of samples up there. Now, I need to figure out how I should display a tag list or cloud on the homepage to navigate. Probably should make a little "syntax help" link when creating madlib stories too.

Weird, I can't reproduce that inquiry error and Hoptoad didn't catch anything. Let me know if you run into that again.

Thanks for your feedback and contribution!

bonquesha99··on Ask HN: What are you working on (hacking)?
http://madlibber.com/ - Anonymous user generated madlibs. I can't stop working on this [adjective] app!

http://webchiever.com/ - Web achievements

http://inquiryapp.com/ - Hosted FAQs for your apps

bonquesha99··on Ask HN: review my tiny app - anonymous user generated madlibs
I couldn't find any other sites that allowed you to specify your own prompts instead of making you choose from a list like "noun", "adjective", etc. So, I decided to take a crack at it for fun.

It also supports backreferences, and doesn't look all dated like most of the other madlib sites.

bonquesha99··on Ask HN: I know this isn't reddit, but please review my cannabis-related startup
or cannabisseur (see my other comment)
bonquesha99··on Ask HN: I know this isn't reddit, but please review my cannabis-related startup
Awesome, I had this same idea recently. I wanted to call it Cannabisseur and have the logo be a smug cartoony guy like the reviewer in Ratatouille, but smoking a joint or something.

I just didn't know enough about cannabis to really follow thru with it. Plus I came across http://nugporn.com/ and figured there were other strain reviewing sites like it.

bonquesha99··on What if Hacker News Has Badges? Who'd Get What?
It really depends on what kind of badges/achievements are created.

We definitely wouldn't want anything like "submitted 10 posts to HN", but something like "submitted the most popular comment in an article" might be cool.

bonquesha99··on Ask HN: Heard of any good startups?
http://webchiever.com - web achievements

http://inquiryapp.com - faq hosting service

bonquesha99··on Ask HN: review my startup concept - web achievements
Could you clarify what you meant by this? When a new game is created, the developers of the game will be responsible for defining the achievements in webchiever.
Page 1 of 2Next →