/blog/index.xml

Free Up Inventory in Real Estate Market

How to free up inventory in the real estate market

Here’s a scenario that happened to my friend’s parents:

They bought a house in San Diego in the 1970s before they had kids. They paid around $20,000 for the house.

In the 1980s, after having kids, they moved to a bigger house in a different part of the county where the schools were better. The housing market was unusual in the ’80s, so they kept the $20,000 house and converted it into a rental property. It’s now 2024, and they are retired.

The $20,000 house is now worth $1.2 million. They want to sell the house and use the profits help fund their retirement. However, after speaking with their accountant, they learned that if they sold the house, they would owe around $700,000 in taxes, including both state and federal taxes. They are currently receiving about $3,500 in rent from the house, so they decided not to sell it and to keep it as a rental.

This story is more common than people think. Many boomers are sitting on significant real estate holdings but don’t want to sell due to the tax burden.

My Proposal

We should create a one-time tax holiday to allow these individuals to sell their properties without paying capital gains taxes. The tax holiday would work as follows:

  • If a second home or rental property has been owned for more than 10 years, the federal government would exempt capital gains taxes on the sale of the property and also not require the taxpayer to repay depreciation on the rental property.
  • The seller should receive some form of tax credit for any state taxes paid.
  • We could cap the tax holiday, for example, if the house is worth more than $1 million, we’d only exempt up to $1 million in capital gains.
  • Implement a 3-4 year window to encourage people to sell sooner rather than waiting for further price appreciation.

Read More

From Ruby to Python - Bundler and Poetry

From Ruby to Python - Bundler and Poetry

Ruby and Python are two popular programming languages known for their simplicity, readability, and extensive libraries. Both languages offer package managers to handle dependencies and streamline project development. In the Ruby ecosystem, we have Bundler, while in Python, I have come to rely on Poetry. Let’s look at these two tools, exploring their features, usage, and benefits.

Dependency Management

Bundler

Bundler, the Ruby dependency manager, uses a Gemfile to define project dependencies and their versions. Bundler resolves the dependencies and installs the required gems (libraries) into the project.

Poetry

Poetry, the Python dependency manager, employs a pyproject.toml file to define dependencies, versions, and other project metadata. Poetry resolves the dependencies and installs them into the virtual environment, which isolates the project from the system Python installation.

Read More

Postgres - Use temporary table to query from CSV

Postgres - Use temporary table to query from CSV

If you need to compare the contents of a large CSV file the to data in your existing database, you might want to take advantage of temporary tables. A temporary table exists only for the duration of the database session or transaction in which it is created. These tables can be useful for storing intermediate or temporary data that you need to compare to your live data but don’t want to persist in the database permanently.

Let’s look at an example:

CREATE TEMPORARY TABLE temp_uploaded_orders (
  order_id INT,
  store_id TEXT,
  settled BOOLEAN
);

Read More

Postgres Tricks - Convert jsonb string to hhmmss from seconds

Postgres Tricks - Convert jsonb string to hhmmss from seconds

We sometimes need to convert strings to dates to intervals and back to string in Postgres. One common set of queries I reach for is to convert “seconds” field into something that is readable by human. Most of us read times in the “hh::mm::ss” format and don’t like to do math in our head.

Here’s a simple query with to_char to convert seconds into this format:

 SELECT TO_CHAR('95 second'::interval, 'HH24:MI:SS')
 -- "00:01:35"

Read More

tobr - Generate a branch name form story title

If you are lazy like me and thinking of branch names is mentally taxing, it is time for a tool. I’ve been using this small ruby script for over 3 years to generate branch names. The script looks like this:

#!/usr/bin/env ruby
# Usage: tobr "Add customer phone Number"

text = ARGV.first || ""
puts text.gsub(" ","_").downcase

Read More

Enum Methods comparison in Ruby/ Javascript and Elixir

Enum Methods comparison in Ruby/ Javascript and Elixir

all?

The all? method in Ruby returns a boolean value (true/false) if all the objects in the list either return true or satisfies the block condition.

Ruby

Enumerable#all?

No block:

>> [ true, "dog", "bear", 19 ].all?
=> true
>> [ nil, true, "hello" ].all?
=> false

With a block:

>> %w(cat dog squirrel bear).all? { |word| word.length >= 3 }
=> true
>> %w(cat dog squirrel bear).all? { |word| word.length <= 3 }
=> false

Elixir

Enum.all? No block:

>> Enum.all?([ true, "dog", "bear", 19 ])
true
>> Enum.all?([ nil, true, "hello" ])
false

With a block/fn:

>> Enum.all?(["cat", "dog", "squirrel", "bear"], fn word -> String.length(word) >= 3 end)
=> true
>> Enum.all?(["cat", "dog", "squirrel", "bear"], fn word -> String.length(word) <= 3 end)
=> false

Javascript

Array.prototype.every()

Only with callback support:

> [ true, "dog", "bear", 19 ].every(x => x)
true
> [null, true, "hello" ].every(x => x)
false

> ["cat", "dog", "squirrel", "bear"].every(word => word.length >= 3)
true
> ["cat", "dog", "squirrel", "bear"].every(word => word.length <= 3)
false

Read More