bonquesha99
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"]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 starsProof 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...
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
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/18ad65801People 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!
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/18ad65801Tech: 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 # 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")
endRE 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!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
endKeeping Data in Sync with ActiveRecord::UpdatedAt
Zero Downtime Migrations with ActiveRecord and PostgreSQL
* 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
Docker ID: shuber
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.
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
Show HN: Promiscuous – the ultimate context switcher using Git and Vim sessions
* 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. * 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.