Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mark242
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
181.
▲
by
mark242
10y ago
The match is just my personal preference to deal with option types, because I personally think it's cleaner to read. This reduces the number of flatMap chains in my code, but again, personal preference. Option(JavaClassFactory.stat
182.
▲
by
mark242
10y ago
Your very first method has a return buried in the middle of your code. That is a gigantic red flag. Look, what you're trying to do is simple. getNumbers.fold(println("Failed to load numbers"))(nums => nums.foreach(prin
183.
▲
by
mark242
10y ago
Option is a takeoff of the Null Object pattern. Option(null).map(str => str + "!").foreach(str => println(str)) is a noop.
184.
▲
by
mark242
10y ago
In Scala, you're encouraged to write more bulletproof code by avoiding exceptions at all time, simply because it's easier to realize that (in your case) getSomeRiskyNumber returns an option instead of an integer. getSomeRiskyN
185.
▲
by
mark242
10y ago
A flexbox "column" can also be a row. You can have a container item centered vertically and also have it include two items.
186.
▲
by
mark242
10y ago
Obligatory "did you try running sbt ~ compile before you started complaining about the compile times" post. It's amazing how the tools for faster turnaround times exist-- the one thing the Scala community needs to do a better
187.
▲
by
mark242
10y ago
I don't understand how lines 4 and 15 don't get caught by the compiler-- a String cannot extend an Integer? I'm not even sure how you would be able to write this in Scala without violating rule number 1 of Scala, which is &qu
188.
▲
by
mark242
10y ago
+1 recommendation for The Great Suspender. Works like a charm, noticeable difference on overall system performance.
189.
▲
by
mark242
10y ago
Just anycast cdn.ampproject.org to a cluster sitting on your network with Google's supervision and cert? This is added value for the provider, just like sticking a bunch of Akamai boxes on your network is added value.
190.
▲
by
mark242
10y ago
Okay but let's be realistic-- you are not a major publisher trying to make money off these pages. You can say "yes my page loads in 100k and 300ms until DOMContentLoaded" all you want, that doesn't change the fact that w
191.
▲
by
mark242
10y ago
Sure. AMP is a good thing. Google is simply the first company to implement the AMP cache-- Cloudflare has recently spun up their own and outbound links from Cloudflare-enabled sites can use an AMP cache that doesn't rely on Google, so
192.
▲
by
mark242
10y ago
"I dont have a fixed telephone number anymore. How to handle that?" Get a fixed telephone number.
193.
▲
by
mark242
10y ago
"My inner tin foil hat says Google wants a phone number for other purposes." "I already have an Android phone with Google Play Services installed." Guess what - Google already has your phone number before asking for it v
194.
▲
by
mark242
10y ago
This rant is exactly why phone numbers are a good way to do two-factor. The author lost control of their phone number ("as i quit the account shortly...") and subsequently had an extremely hard time authenticating to their bank,
195.
▲
by
mark242
10y ago
Here's the important piece of information, from the conflict resolution page: "Compare their string values with JSON.stringify, choosing the greater of the two." In other words -- don't ever use this database in producti
196.
▲
by
mark242
10y ago
If a promise in the array is rejected, Promise.all (which returns a promise) rejects with (supposedly) the first rejected promise, but that's extremely hard to predict if you have two promises which could reject. Serializing a promise
197.
▲
by
mark242
10y ago
Yeah, look into using Promise.all. You're probably looking at a good few hundred lines of code reduction. What you're describing as a "command" (request / state update) is just a promise with a map function applied.
198.
▲
by
mark242
10y ago
I suspect that using Promise.all() helps greatly with this.
199.
▲
by
mark242
10y ago
Here's your user assumption: 99.8% of browsers have Javascript turned on. Creating a fallback version of your app that works without Javascript is basically like developing for IE 5 -- you are completely wasting your time. Here's
200.
▲
by
mark242
10y ago
tldr: Someone wrote a bunch of paragraphs and LOC around JSON.parse(window.localStorage.getItem(key)). If you're really interested in learning about creating a workable offline web app, Google has some great documentation. https:/
201.
▲
by
mark242
10y ago
Those cane fields on the way from Kahului to Kihei, while beautiful, seem like a massive wasted space. I like the idea of a decently-sized solar farm to replace the power plant just above Kihei.
202.
▲
by
mark242
10y ago
Beef is very plentiful on Hawaii - there is a large amount of history about the paniolos, basically cattle ranchers on the Big Island and Maui. Parker Ranch, on the big island, is a huge supplier of beef. http://parkerranch.com&#
203.
▲
by
mark242
10y ago
Didn't they switch to the subscription model because people weren't upgrading enough to sustain the business?
204.
▲
by
mark242
10y ago
I still don't understand why, after having grown to a sufficient size, Reddit doesn't just enforce two-factor at account creation time. Tie a user to a phone number at the very least.
205.
▲
by
mark242
10y ago
If you were ever wondering why Google started AMP, this is it. 5k+ LOC of inlined Javascript, 2.6MB of data and a 13 second load time.
206.
▲
by
mark242
10y ago
From the post: "Well a big one: Privacy of the readers of Pepper&Carrot." Before even thinking about tossing things like Google Fonts or AddThis or whatever, the very first thing you need to do is turn on HTTPS. If you're
207.
▲
by
mark242
10y ago
Quick feedback for the AWS team: * First, this is great. The simplified interface vs EC2 is terrific. This is the direction EC2 (and RDS and S3 and basically everything) needs to be going. * Instances you start in LightSail don't show
208.
▲
by
mark242
10y ago
on edit: There are so many of these companies that are basically stylized versions of Alibaba listing pages or are basically re-skinning of some business process that, turns out, doesn't actually need to be disrupted. Transporting gaso
209.
▲
by
mark242
10y ago
You misspelled "Hibernate". Hope this helps.
210.
▲
by
mark242
10y ago
If the Secretary of the Treasury designates China as a currency manipulator, your new iPhone will wind up costing you $2000. What madness.
More ›