jasonl99
Joined 12 years ago
Joined 12 years ago
That said, I started playing around with the Marten framework and while it's really new, it's an amazingly good start. I absolutely love the way that models automatically create migrations. Using Sqlite as a default is good for probably 99% of uses cases, and absolutely good for learning the framework (Sqlite itself is amazingly powerful).
I've been wondering what new shiny toys I was going to play around with over vacation during the holidays, and I now have my answer :).
― George Bernard Shaw, Man and Superman
I've always used this as an excuse for what might be considered being weird (at least that's what my family tells me).
\dt cust*
will list all tables that start with "cust". It works with other commands as well (like \l).
Also, I like to split my terminal using tmux, and have a neovim editor in one pane, psql in the other. I just keep doing "\i file_name.sql" as I perfect the query.
I definitely agree wholeheartedly about pspg. They even have a FoxPro theme, which has a special place in my heart :).
I changed it to \setenv PAGER 'vd' and I just get a big chunk of text with no ability to navigate columns. How are you doing it with mysql?
I'm using clients for Mac, Android and linux (manjaro) and all work well. There are also clients for the other major platforms.
One of the things I really like about it is I can do a screenshot on both Mac & linux, saving to the clipboard rather than a file, and paste it directly into an editor and inkdrop handles everything, including creating a file and corresponding markup. And that all syncs too.
A side benefit of this is that F5 is mapped to refresh for a lot of apps (Firefox, for one) so I can hit capslock to refresh a page.
I use this as one part of a multi-pronged approach, dusting around areas they would need to cross to get into the house. It's super-cheap and lasts a long time.
It does need to stay relatively dry, though. When I've needed to repair drywall on occasion, I dust a bunch in the opening figuring it will basically last forever and not get wet.
I also use a bait with boric acid placed in various random areas. I also use a product that slowly emits a vapor in closed areas that basically neuters any roaches that get near it (for places like under the sink). Finally I used Home Defense spray around the outside.
I treat the condo once every three months, and it takes about 30 minutes. I've seen maybe two cockroaches in the past few years, and both were belly-up.
Within that article he describes "a 15-person startup company called Robotica has the stated mission of “Developing innovative Artificial Intelligence tools that allow humans to live more and work less.” It does not end well.
https://waitbutwhy.com/2015/01/artificial-intelligence-revol...
It is interesting that a timestamp without timezone is internally represented a timestamptz at UTC.
Postgres is also has some great functionality converting between timezones:
https://www.postgresql.org/docs/11/functions-datetime.html#F...
Here's a quick demo class that shows the technique. It's amazingly simple.
class Demo EXAMPLE = { "75%" => 0.75, "15%" => 0.15, "9%" => 0.09, "1%" => 0.01 }
def self.sample(choices = EXAMPLE)
choices.max_by { |_, weight| rand ** (1.0 / weight) }.first
end
def self.show(samples: 10000)
items = samples.times.map {sample}
items.each_with_object(Hash.new(0)) do |item, counts|
counts[item]+=1
end.sort_by(&:last).reverse.to_ h
end
end# Demo.show # => {"75%"=>7480, "15%"=>1525, "9%"=>901, "1%"=>94}
Edit: Sorry for the bad formatting. I added a gist:
https://gist.github.com/jasonl99/25d3c922d73f10a75fe228c2de3...