5100
How to exclude getter only properties from type in typescript - Stack Overflow
// https://github.com/Microsoft/TypeScript/issues/27024#issuecomment-421529650
type IfEquals<X, Y, A, B> =
(<T>() => T extends X ? 1 : 2) extends
(<T>() => T extends Y ? 1 : 2) ? A : B;

type WritableKeysOf<T> = {
[P in keyof T]: IfEquals<{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P, never>
}[keyof T];
type WritablePart<T> = Pick<T, WritableKeysOf<T>>;
typescript 
2 days ago
Overloading Global Secondary Indexes - Amazon DynamoDB
modeling entities as "entity id is hash key", "column name is sort key", so you can hack around GSI limitations and have 1 index on the "attribute 1" column.
dynamo 
4 days ago
TypeScript: Create a condition-based subset types – DailyJS – Medium
explanation of SubType as a general "extract keys based on a condition"
typescript 
4 days ago
Javascript Classes v. Closures (2/3) – Engineering@Livestream – Medium
I will admit I do not fully grok Egorov’s very technical response, but the understanding that I do get is, basically, v8 rocks at doing classes.
javascript 
10 days ago
Protobuffers Are Wrong :: Reasonably Polymorphic
tldr: the type system is driven from impl concerns, so doesn't compose/generify like type systems should
programming 
12 days ago
The Go Playground
example of returning nil, but its wrapped in an interface, so doesn't look nil
golang 
20 days ago
John Urschel Goes Pro – Hmm Daily
There’s no such thing as impostor syndrome in football, he tells me. “Everyone in college football thinks they’re NFL-bound,” he tells me. “If you have that personality of ‘what am I doing here?’, you’ve gotten weeded out a while ago.”
math 
24 days ago
keyof to produce a runtime array · Issue #13267 · Microsoft/TypeScript
can't make a runtime value based on compile-time types, although there is a plugin to do it
typescript 
27 days ago
Functional Core, Imperative Shell
functional/immutable data structures on the inside that are organized by the imperative shell.

imperative shell is actually untested because it has basically no conditionals.
programming 
4 weeks ago
Error Handling | Joyent
People use the term "errors" to talk about both operational and programmer errors, but they're really quite different. Operational errors are error conditions that all correct programs must deal with, and as long as they're dealt with, they don't necessarily indicate a bug or even a serious problem. "File not found" is an operational error, but it doesn't necessarily mean anything's wrong. It might just mean the program has to create the file it's looking for first.

By contrast, programmer errors are bugs. They're cases where you made a mistake, maybe by forgetting to validate user input, mistyping a variable name, or something like that.
4 weeks ago
Good Spirits: Syncing Data Statelessly — Archagon Was Here
mobile app that stores property value/lamport timestamp for syncing. gpl.
crdts 
6 weeks ago
Naval on Twitter: "How to Get Rich (without getting lucky):"
You will get rich by giving society what it wants but does not yet know how to get. At scale.
business 
8 weeks ago
Dad’s company made burgers. Mine just eats them | Aeon Essays
We call ourselves web developers, software engineers, builders, entrepreneurs, innovators. We’re celebrated, we capture a lot of wealth and attention and talent. We’ve become a vortex on a par with Wall Street for precocious college grads. But we’re not making the self-driving car. We’re not making a smarter pill bottle. Most of what we’re doing, in fact, is putting boxes on a page. Users put words and pictures into one box; we store that stuff in a database; and then out it comes into another box.
programming 
8 weeks ago
Opinion | The Bitter Regrets of a Useless Chinese Daughter - The New York Times
Before my mother’s illness, I spurned what I saw as an excess of pragmatism among Chinese people, who want to ensure that all of their efforts go toward something useful. College degrees, jobs, friendships, marriages — all these should be chosen practically. “Be wise, pick an able man. Love doesn’t feed you,” my people like to say. Looking back on my high school years, all my relatives tried to talk me, a top-ranking student, into majoring in science or finance in college. But I was stubborn enough to stay with my favorite subject, literature. Now I understand them.
misc 
8 weeks ago
Hey Reddit, I just broke the overall piston-driven land speed record! 448.757MPH : pics
I use 1.5 feet per second is roughly equal to 1 mile an hour. It’s actually 1.46666666666666666 feet per second is equal to one mile an hour.

So, from the time their front bumper is equal with yours to the time their rear bumper is passing your front is the length of their car divided by 1.5’ per second, gives you how much faster they were moving.

A Honda Accord is about 15’ in length for reference. If they pass you in less than a second, it’s at least 10 mph faster than you.
misc 
10 weeks ago
square/javapoet: A Java API for generating .java source files.
nice joist-ish library for codegen, takes are of auto-imports, etc
java 
10 weeks ago
The Tyranny of Stuctureless
there is no such thing as structureless--human nature is such that there is always a hierarchy. thinking you're "structureless" just makes it a hidden and unfair game.

democracy makes it a visible and "fair" game:
- delegation of authority for specific tasks
- executors are still responsible/accountable to the wider group
- distribution of power across many people
- rotation of tasks among individuals
- allocation of tasks along rational criteria
- diffusion of information to everyone, and
- equal access to resources
management 
10 weeks ago
Life Beyond Distributed Transactions: An Apostate's Implementation - Document Coordination
I need to design my interactions so that both the business data and communications transact together.
programming 
10 weeks ago
Jarrow Formulas : QH-absorb
QH-absorb® is a proprietary, enhanced-stability formula, clinically shown in humans to increase Co-Q10 levels by 215% at 100 mg per day and by 777% over baseline at 300 mg per day. (Mentioned by Attia)
health 
11 weeks ago
Do calories matter? - Peter Attia
Obesity is a growth disorder just like any other growth disorder.  Specifically, obesity is a disorder of excess fat accumulation.  Fat accumulation is determined not by the balance of calories consumed and expended but by the effect of specific nutrients on the hormonal regulation of fat metabolism.  Obesity is a condition where the body prioritizes the storage of fat rather than the utilization of fat.

thermodynamics viewpoint is correct, but assumes calories consumed and calories stored are independent variables. they are not.
health  keto 
11 weeks ago
Good Sugar vs. Bad Sugar, Know the Differences | Factor75
HFCS = 50% fructose, "free and unbound", immediately available for fat storage
agave nector = 90% fructose, "low GI", but due to fructose being metabolized in liver instead of blood stream
raw honey = GI of 30, ~good; processed honey has GI of 75
maple syrup = low in free fructose, but 66% sucrose, so 33% fructose, choose darker grades, GL 8.
molasses = 50% free fructose, another 25% via sucrose
coconut palm sugar = ~40% fructose

best fruits: blueberries, strawberries, grapefruit
health  keto 
11 weeks ago
Keto Diet Plan: The Best and Worst Low Carb Sweeteners | Ruled Me
stevia == good
allulose == good, 1.5x table sugar
Erythritol == sugar alcohol, good, secreted in urine
Xylitol == sugar alcohol, okay, toxic to dogs, possible GI discomfort
maltitol == sugar alcohol, actually high GI, high GI discomfort
sucralose == good if liquid, splenda bulk form still spikes insulin
aspartame == good according to studies, not good for higher temps
saccharin == no proven side effects, but less popular, avoid
overall: use erythritol, stevia, and liquid sucralose
health  keto 
11 weeks ago
Deep-Frying With Peanut Oil Vs. Other Oils | LIVESTRONG.COM
Peanut oil is a healthy alternative to other types of oils. Peanut oil, like other types of vegetable oils, is low in saturated fat and is free of cholesterol and trans fat. Like olive oil, peanut oil is high in monounsaturated fat, which can reduce your risk for cardiovascular disease when eaten as a replacement for unsaturated fats.
health 
11 weeks ago
Periodic fasting starves cisplatin‐resistant cancers to death | The EMBO Journal
Recent research by Obrist et al (2018) shows that cisplatin‐resistant growth of lung adenocarcinoma is particularly vulnerable to periodic fasting cycles and starvation‐induced cell death, due to its dependency on glutamine, required for nucleoside biosynthesis, suggesting an opportunity for nutritional anti‐cancer interventions.
cancer  health 
11 weeks ago
How we scaled nginx and saved the world 54 years every day
Which means that if an event handler needs to read from disk, it will block the event loop until the entire read is finished, and subsequent event handlers are delayed.
programming  nginx 
11 weeks ago
Apache Voting Process
+0: 'I don't feel strongly about it, but I'm okay with this.'
-0: 'I won't get in the way, but I'd rather we didn't do this.'
-0.5: 'I don't like this idea, but I can't find any rational justification for my feelings.'
++1: 'Wow! I like this! Let's do it!'
-0.9: 'I really don't like this, but I'm not going to stand in the way if everyone else wants to go ahead with it.'
+0.9: 'This is a cool idea and i like it, but I don't have time/the skills necessary to help out.'
programming 
12 weeks ago
RFC 7636 - Proof Key for Code Exchange by OAuth Public Clients
to mitigate mobile side-attack of watching auth-code come back:
1) 1st request to auth server has hash(secret)
2) 2nd request to auth server has secret, to prove, yes, i'm the process that made the 1st request.

e.g.:

* only give auth code to the pre-registered/trusted client uri (via URLs/app links)
* only give auth token to the process who provably made the 1st request (s2s uses pre-shared client secret, mobile uses one-time secret)
oauth 
july 2018
Authenticate with a backend server  |  Google Sign-In for Android  |  Google Developers
Verify the integrity of the ID token
* The ID token is properly signed by Google.
* aud is equal to your client ID, e.g. the token was not issued to a malicious app
* iss is equal to accounts.google.com
* exp has not passed
oauth 
july 2018
Understanding OAuth 2.0 and OpenID Connect — Runscope Blog
OIDC == oauth2 with a defined identity token and fixed scopes (openid, profile, email, address, and phone)

claim = name/value pair embedded in access/id tokens. JWT defines the concept, but no specific name/value pairs.
oauth 
july 2018
Twitch streamers who spend years broadcasting to no one | Hacker News
Yeah. Speaking as someone who ran a rather large fansite about NIN in the 2000s (the entity now basically exists as a Twitter account), you really cannot just "grow organically" on today's internet. I like to tell people I have a marketing allergy. Self-promotion feels gross. The "if you build it, they will come" mantra from Field of Dreams is not applicable to a world where so much more content is being created than can possibly be consumed.
business 
july 2018
Why Does Your Company Deserve More Money?
If you have 12-15 months of runway, and aren't seeing growth+retention, get very lean. You don't deserve a series A.

If you're selling preferred shares: can you convince *yourself* and *your spouse* that this business is worth *the next 10 years of your life*?

1. Is the product delighting users/paying customers, such that they'll talk to each other? If your revenue is ads, your customers are advertisers.
2. Do you have enough ownership to give you choices down the road.
business 
july 2018
Designing GraphQL Mutations – Apollo GraphQL
* Specific mutations that correspond to semantic user actions are more powerful than general mutations
* all mutations have FooInput and FooPayload
* use nesting within FooInput and FooPayload
graphql 
july 2018
Meet Bandaid, the Dropbox service proxy | Dropbox Tech Blog
Request queueing implemented inside the proxy allows for better management of overloaded backends. Bandaid always processes requests in Last In, First Out (LIFO) order. When the system is not overloaded, the queue will be empty (or almost empty). Thus there’s no real difference between popping requests from the front of the queue or the back of the queue. Where LIFO processing reduces overhead is when the system is overloaded. By processing the newest requests first—since the oldest requests are likely to time out soon—we avoid spending CPU cycles on expiring requests.
programming  http 
july 2018
Thrift + Graphs = Strong, flexible schemas on Hadoop - thoughts from the red planet - thoughts from the red planet
enum Gender {
MALE = 1, FEMALE = 2
}

union PersonPropertyValue {
1: string name;
2: i16 age;
3: Gender gender;
}

struct PersonProperty {
1: PersonID id;
2: PersonPropertyValue property;
}
thrift 
july 2018
(17) Rodrigo Muñoz - GraphQL Live: Reactive Queries at Facebook - YouTube
* subscriptions are great, but assume you know what business event you want to listen for
* queries have may computed field that don't directly expose what upstream fields they're based on.
* if you have N subscriptions-on-mutations, you can add the field (potentially via a fragment) to each one
* and note, not every subscription that touches that fragment, only those subscriptions for business events that explicitly change the description, as otherwise you're over-fetching.
* all of these entail "a developer finds where that changes description"

* subscriptions & live queries are isomorphic--subscriptions are business change events, live queries are "state is now Y"

complications:

* over-observing: if query to backend ends up being a "select *"
* masked dependencies: if query response uses a cache hit, you miss what the underlying data dependency would have been for a cache miss
* partial reactivity: some data sources are react, some are not, and developers can't tell which will/will not be live.
graphql 
july 2018
(17) Tom Ashworth - GraphQL at Twitter - YouTube
* twitter uses sangria
* assign query cost based on levels of nesting
* use persisted query ids to prevent malicious calls
* subscription is client listening for "event", map it with a "query", and receive the "payload"
* after an event, they're just re-executing query against the real api
* strato is twitter's existing rejoiner/federated database
graphql 
july 2018
(17) Rob Zhu - GraphQL Subscriptions: Full Stack - YouTube
* subscription takes a source stream and maps it to a response stream
* server has to divine what source stream the query was for
* streaming transport == websockets (small) -> rsocket/MQTT (distributed)
* connection handling == in-process (small) -> gateway/proxy (distributed)
* source stream == in-process (small) -> redis, kafka, SQS, pusher (distributed)
* subscription session data == in-memory (small) -> database/cache (distributed)
* currently powering live likes/comments, typing indicators, live video comments, reactions, many more
* live queries: just rerun queries.
* if T+1 to T+2, value goes from 5 -> 15, subscriptions tell you "this went up by 10" (observing events), live queries tell you "this is now 15" (observing state)
* subscriptions require event system + domain-specific events, live queries require a reactive data layer
* subscriptions tell you "why", live queries don't
graphql 
july 2018
(17) Dan Schafer - GraphQL: Client-Driven Development - YouTube
* unapologetically driven by needs of frontend views
* language and runtime is built around that
* "think in graphs"--tried using SQL/FQL, did not work well
* "thin api layer"--there was still a huge monolith behind the iOS graphql (e.g. FB's 'ent' PHP monolith), they just replaced the FQL queries/proxies w/graphql queries/proxies

* "scaling models"--had been using coredata, so graphql query was mapped to coredata xml config. first by hand, then by codegen via .graphql files. so added fragments.
* only added fragments after proven need on the client.

* "scaling views"--large coredata files, mutable objects, but react/componentkit/litho one-way views now best practice, so were moving to flux across the board: immutable vended views. what are flux actions? command pattern. so added mutations.
* only added mutations after proven need on the client. "why top-level mutations"? it's flux. that is why there is no CRUD.

* "scaling updates"--subscriptions. 1st impl was 4 months long, prototyped with polling.

* "scaling the language"--added directives, @include(if), at last minute, cleaning up uglier field syntax.

everything was client-driven.
graphql 
july 2018
Multiplatform native development in Kotlin. Now with iOS!
on module contains code that is not specific to any platform, as well as declarations without implementation of platform-dependent APIs. Those declarations allow common code to depend on platform-specific implementations.
kotlin 
july 2018
(17) Jason Lengstorf - GraphQL at Massive Scale as the Glue in IBM's Microservice Architecture - YouTube
* ibm cloud front-end will load dojo 1 and 2, 5 versions of angular, react. and of course jquery. sometimes react/dojo/jquery all in the same microservice.
* wild-west, written back when people didn't care about the frontend
* who "owns" the graphql proxy
* will one commit take down the entire graphql proxy/endpoint
* want to schemas out to u-services, then aggregate together. "data sources".
graphql 
july 2018
(17) Adam Kramer - Managing Massive Schemas with Codegen - YouTube
* your graphql schema can/should be mapped 1:1 from your domain objects, e.g. with annotations.
* classes/methods --> types/fields
graphql 
july 2018
SF hospital charged $15K ‘trauma response fee’ for baby that needed no treatment
EMT and ER can activate trauma response, and guidance is to over-activate for safety
healthcare 
july 2018
(17) The Past, Present, and Future of GraphQL Native - Nick Schrock @ GraphQL Europe - YouTube
* nick schrock, graphql co-creator, 2009-2017.
* "revenge of the monolith"
* original super-graph was 1:1 mapping to business/domain layer, from an assumed monolith (PHP/ent), driven by very backend team, delivered JSON/no client, no javascript/react, client was iOS native
* 1st open resource graphql was to JS ecosystem, but just due to relay, which was react+graphql glued together. leverage the react brand. very domain agnostic, JS focused, assumed microservices.
* JS/frontend loves it, backend hates it.
* see AirBNB, reconciling graphql & thrift. cultural problems. but ironically graphql type system can structure your clients.
* this context led to front-end developers sneaking a very small layer of graphql on top of unwitting/unconvinced backend developer micro-services
* micro-services: "those who don't learn from history will repeat it" ... "those who learn too much from history are doomed to overreact to it": history of software engineering is devs overreacting to horrific pain.
* SQL to NoSQL, data warehouse to data lake, templates to JSX
* micro-service is an over-correction. they are a tool, not a goal. goal is not "to move to micro-services". no, the goal is to "deliver business value".
* what separation are micro-services for? business logic verticals, repo verticals ("more git repos than engineers is insanity at large", "just use folders"), org boundaries (conway's law, but then reorgs lead to orphaned micro-services and repos), language choices (your org should bet on one, two, maybe three languages b/c code reuse is good), scaling constraints (this is a good reason).
* Attempting to decouple what is actually coupled is a terrible idea. Spreading business logic across systems. You'll end up with a distributed monolith.
* "Your affection for GraphQL is your subconscious telling you that it wants the good parts of your monolith back". You want a cohesive view of your business.
* future of GraphQL native: instead of zero-logic graphql, make a beefier graphql. talk to super-scalable store, talk to other micro-services, talk to capability-based services.
* very few graphql backends from scratch: we need fatter gateways. move cross-system business logic into the gateway. vertically-integrated toolkits. scaffolding/code layout. "rails for graphql".
* pivot graphql back to be a balance between back-end/front-end and not front-end only
graphql 
july 2018
(17) Johannes Schickling - Building GraphQL-Native Microservices - YouTube
* graphcool did graphql-request, graphql-config, graphql playground
* graphql-as-a-service
* graphql as a gateway technology vs. graphql gateway+graphql native
* schema stitching: graphql-tools, graphql weaver
graphql 
july 2018
Best Practices for GraphQL Clients - YouTube
* client should make caching data easy, dedup responses
* client should make paginated queries easy
* client allow us to make mutations
* co-location: have queries next to the code
* don't create shared fragments, purposefully use per-use fragments
* persisted queries: construct queries at runtime and cache them by id (all iOS/android using that)
* log all versions of a named query over time, and its perf by version
* query/response cached: persisted id+variables -> response. TTL/LRU.
* data consistency: use a normalized store so query cache has latest view of nodes.
* pagination: after=null/first=3 (segment1) and then after=3rd/first=3 (segment2) could see dups across inconsistent pages. have controller merge segments.
* mutations: simple mutation, "connectToFriend", can change lots of node: you're in my friend list, my news feed. "blockUser" undoes those.
* mutations: how do you know what to refetch? reuse UI fragments (will over fetch what hasn't change).
*
graphql 
july 2018
(17) GraphQL Schema Design: Tips and tricks from the battlefield - Gustav Rydstedt - YouTube
hasAdmin: hasRole(...)
user.is_me
teacher.ourLessons (notion of "mine"/auth in the graph)
graphql 
july 2018
(17) Lessons from 4 Years of GraphQL - YouTube
how to evolve APIs:
* Would a new engineer understand this? (pick good names)
* What might version 2 look like? (name for org, not school/district)
* Model the data not endpoints/rpc calls (instead of flattening data into UI fields, e.g. storyAttachmentTitle, which means nothing in the real world, expose the product pointer)
* Will this work for all future clients?
* What if the implementation changes?
* do as little as possible in the graphql server itself (dan schafer 2016 talk)

how to build products:
* pick the biggest, most important problem, and drive priorities from that.
* graphql was built by product people, to solve product problems
* don't be beholden to existing best practices
* have a first client to drive concrete needs--embed on their team
* allow incremental adoption, try before you buy.
* evolve, don't rewrite. if your framework requires a rewrite, that is a bad sign.
* yagni, burden of proof is on new tools to prove they are worth investment.
* designers (dreamers) need editors (skeptics)
* software is about communication
* don't open source too early. too many users too soon can be bad.
* encourage taking measured risks (vs. tendency to buckle down and "do what works")
* trust your experienced people
graphql 
july 2018
« earlier      
accounting advertising agile ai ajax algorithms amg android architecture art audio aws backup banking bizo bodybuilding boo books bugs business c# cache carpet cars chairs charts clothing coffee colors communication competitors cooking couchdb css cygwin dabbledb database del.icio.us design design/sparklines designers documentation drugs dvr eclipse ecommerce economics education email engineering exercise filetype:gif filetype:pdf finance firefox fitnesse flash flickr flute flute/discussion flute/ff flute/music flute/performances flute/used fonts food forbes freebsd furniture fuse games gardening gifts gis git go google government graphql grills grpc gtd guns guns/suppressor gwt gwt/bugs hadoop hardware health history hosting hotkey house/tables household html html/editor http humor i3 ie imaging interviews investing iphone ipod java java/gui java/jta java/multicast javascript jquery js js/jquery jsr168 jta keto keyboard knives labels laszlo lifting linux mac management markdown marketing math mealkits media:document media:image medicine memcache memory memory/apps messaging methodology microservices misc mom motivation music mvcc netty networking oauth office omaha orm os outlook outsourcing parenting parsing patents patterns performance philosophy photography photos photos/libraries php physics pm pocketpc podcast politics postgresql ppc presentation productivity progamming programming psychology python quickbooks quotes ra rails react realestate recipes regex religion remodeling remote research rest reviews rfc richclient richclient/javascript rowing rss ruby running s3 saas sales saunas scala scalability scheduler science scm scoliosis scrum security seo shipping shopify sleep smalltalk soap sousvide spark speech sports sql ssh ssl statistics stocks svn swift tags tapestry technology tempagency testing thinking thinkpad threads timetracking tools toread trac travel tvs typescript ubuntu ui uml unix usecases ux vc video vim violin webdav wiki win32 windows wmii writing xml xmonad xp yc

Copy this bookmark:



description:


tags: