Better HN
topnewbestaskshowjobs
Log inSign up

rojoca

123 karma · joined Mar 30, 2011 (15y ago) · 64 submissions

Submissions

comment 4y ago · link · parent

I would second this. A team sport is also a good option. There are always clubs/teams that take beginners.

comment 4y ago · link · parent

You can enjoy all kinds of disgusting and / or ridiculous things when you have some adjacent emotional connection. It’s one of the best things about life, keeping in mind it can work the opposite way too.

comment 5y ago · link · parent

Haven't used django for a year or 2 but used to use django-rest-framework's negotiation to get both json and html responses (was using inertiajs not htmx) and it worked pretty well. You can use decorators on the api methods to set things like templates. Here's an example:

  @inertia("User/List")
  @api_view(["GET"])
  def get_users(request,  **kwargs):
    // ...
    return Response(data={"users": users})
This can return JSON or HTML with the data injected.

comment 5y ago · link · parent

Ira Glass has a practical take on the idea of exposing good taste (e.g. trying to paint like Bellini): https://youtu.be/X2wLP0izeJE where he talks about how your good taste informs you that the work you are doing doesn’t yet match your ambition, and that this can be both motivating and discouraging

comment 5y ago · link · parent

In the unity announcement they go over some of the tools weta have created: https://blog.unity.com/news/welcome-weta-digital

comment 5y ago · link · parent

Clojure has the as-> threading macro (probably borrowed from another lisp) where you can specify the placeholder:

  (as-> [:foo :bar] v
    (map name v)
    (first v)
    (.substring v 1))

comment 5y ago · link · parent

Great, now the timeline is going to be full of "just tweeted X to my super follows, super follow me here: ...". Sounds like more ads.

I guess in fairness you probably don't want to follow people who tweet like this but these kinds of tweets will still be hard to avoid. I'd rather just pay twitter $x/yr for no ads.

comment 5y ago · link · parent

This is what state machines/charts are for. They prevent you from entering invalid states, and take responsibility for all changes in state.

comment 5y ago · link · parent

You can’t do sm:hover:top-[-113px] in a style attribute

comment 6y ago · link · parent

In NZ we have 2 levels, wholesale and retail providers. By law you cannot be both. The price paid by retail providers to wholesale providers is currently set by the commerce commission because the infrastructure being built and managed by the wholesale providers was heavily subsidised by the govt. The (4) wholesale providers are effectively regional monopolies but importantly cannot set their prices, and the retail providers compete on value-add services and price for which there is fairly healthy competition.

comment 6y ago · link · parent

I recently looked around to see if this was possible in gmail and found the following: https://github.com/garyholeman/CreateGmailFilters

It has some limitations but mostly it was useful to learn that google app scripts are a thing.

comment 6y ago · link · parent

> Not censoring an idea and arguing that an idea should not be implemented are not equivalent.

I'm not sure this is correct, but I'm willing to be convinced if you can expand a little more. I guess I see it as censoring the act of censoring.

> If this is true, i.e. reporting of the censorship increases the visibility of the bad idea, then it completely destroys the pro-censorship argument that it reduces the visibility of bad ideas. It would also immediately cease to be true if censorship ever became uncontroversial, in which case you couldn't claim that it's giving the allegedly bad idea a chance at a fair debate.

In this case, it is true. But youtube censorship is not equivalent to societal censorship, it just signals that youtube does not endorse Icke's ideas and does not wish to publish them, but people can still evaluate them somewhere else.

> Is somebody suggesting that YouTube should be prohibited from creating and distributing their own videos?

No, the suggestion is they should not be allowed to write their own terms and enforce them.

comment 6y ago · link · parent

The following may seem frivolous and/or uncharitable but I think you would find them hard to disagree with:

- booting people off platforms is a "bad idea" which you wish to "suppress".

- booting people off platforms shines a light on their "bad ideas"

I'm sympathetic to the spirit of your comment, but I think Mr Icke has plenty of other ways to publish his ideas, and I don't believe youtube is suppressing them in a way that necessitates suppression of theirs.

comment 6y ago · link · parent

A web service can provide a schema similar to a header file to define its API but there is no "standard" format for this schema, nor is there a standard location to look for such a thing.

You can of course provide your own schema. This tool lets you design an API for a web service in a popular schema format called OpenAPI.

comment 6y ago · link · parent

I created my own adapter for rest framework specifically. Currently trying to extract it from my project into its own library. Will publish to pypi when it’s ready. Repo[1] if you want to see the approach. Also, there is a fork of inertia-django[2] that has a reference implementation of PingCRM[3]

[1]: https://github.com/rojoca/django-rest-inertia [2]: https://github.com/zodman/inertia-django [3]: https://github.com/zodman/django-inertia-demo

comment 6y ago · link · parent

Since inertia runs in the same session context as your django app you can use django sessions as you would in a standard django app - in fact this is the goal of inertia. This even works with a django rest framework API

comment 6y ago · link · parent

I totally understand people's preference to use Django templates wherever possible, and only sprinkle in more frontend focused stuff when needed, but personally, I would rather just write the whole frontend in React or Vue.

This is probably partly due to the fact I find working with django rest framework serializers / views to be much nicer than django forms / views.

I think what puts most people off is the default requirement to go all-in and create an SPA with global state management and client-side managed routing, but this isn't actually necessary.

I have found incorporating Django with https://inertiajs.com to be a pretty solid alternative. I can write the whole frontend in React, and the backend in Django rest framework, but everything is still page based, so I don't require redux or any other kind of global state, just use the inertia utils to make page transitions.

NextJS is another alternative. To talk to a (django) API you need to go through getStaticProps and getServerSideProps which, depending on the location of your API server, can be a little slow, but you get pre-rendered HTML and page based routing so again no global state management required.

comment 6y ago · link · parent

No, you just create a new card component and adjust the tailwind classes on it.

Or, if it is a minor change, then conditionally include / exclude a small subset of tailwind classes.

The point is to not write your own CSS, you only use tailwind classes. In this way you can look at the template for each of your components and reason about / edit their style and layout easily.

comment 6y ago · link · parent

For js there are various implementations including this one: https://xstate.js.org/docs/

Here is an article by the author of this library with some justification for the appropriateness of statecharts in UI construction: https://dev.to/davidkpiano/no-disabling-a-button-is-not-app-...

comment 7y ago · link · parent

This arguably also punishes their competitors.

comment 8y ago · link · parent

Also the source(?) of this change from instagram: https://engineering.instagram.com/copy-on-write-friendly-pyt...

22.

The Humanity Star(thehumanitystar.com ↗)

5 points · by rojoca · 8y ago · 1 comment

comment 8y ago · link · parent

What about mentally ill people? People on medication that make them groggy? People who are drunk in their own home? People who are exhausted from a huge week at work? Children? Elderly?

People cannot reasonably be expected to “stay calm” at a moments notice. That is completely unreasonable.

comment 8y ago · link · parent

The other solution is to have mixed representation where a portion of the seats represent districts and the rest are allocated to match the proportions voted for by the state. In this case each voter gets 2 votes: 1 for their district and 1 for a party.

comment 8y ago · link · parent

Proportional voting is the only way to eliminate gerrymandering. Approval voting is great but single winner elections are always going to have gerrymandering issues.

comment 9y ago · link · parent

Have to say they are very comfortable. The quality has improved a lot since the Kickstarter version.

Not in SV; just a fan of the founder’s former football team.

comment 9y ago · link · parent

One (unsuccessful) party in the recent NZ election proposed a tax on productive assets, including land and housing but excluding financial assets which would already be taxed. It would only be levied if those assets did not produce some minimum return. This was in response to the wild property speculation that has made housing increasingly unaffordable for many people as well as stagnating productivity.

comment 9y ago · link · parent

> I'm not well-informed enough to say much, but imagine you have a local link in a small rural town that only support some absolute number of packets or whatever: if you have one big consumer that is eating the major part of that every day, making the others miserable, isn't it reasonable to limit that consumer's bandwidth somehow?

> Then if some law is enacted to prevent you from limiting that consumer, then you'll either make the lives of the others miserable or you'll be forced to spend more on your link and luckily pass the cost down to all your consumers. Right?

Yes but the consumers of the bandwidth are the locals in that small rural town, not netflix. Charge the locals for using more bandwidth because they are the ones requesting it.

comment 9y ago · link · parent

https://github.com/Originate/git-town/blob/master/documentat...

I think it would be good if the docs had the git commands that are run for a git-town command.

123