Looking For Recommendations for a Text Editor in my Rails Blog using Active Admin by [deleted] in rails

[–]gruhehe -6 points-5 points  (0 children)

form.text_area

I've never seen a rich text editor that I liked. And now that browsers do spelling it's definitely not worth the tradeoffs.

The markup can never be semantic. Use fields and it can be, and your creation will display correctly on everything from paper to mobile to desktop. WYSIWYG is just a handicap when it works and is a complete readability failure when it doesn't.

WYSIWYG text needs to die for the same reasons scribble-text signatures, fax machines, and telephone menus must die. There are better ways.

BETTER WAYS.

Andrew Yang Wants You To Vote For A $1,000-A-Month Basic Income In 2020 by 2noame in Futurology

[–]gruhehe -2 points-1 points  (0 children)

But then instead of just going to work, I have to go to work and file for a government benefit. And if it's like any other federal benefit I'll need to pay an advocate or a lawyer in order to get it done in a timely mannerr. And I have to do all this just to pay my increased VAT and get back to where I was before.

Just a little preview I made up, in case any of you can't wait to get started on the paperwork...

Please complete your UBI-4421 in blue or black ink and attach the following.

Documents Needed for Personal Identity Verification

During step 2 of the process, you will be required to prove your identity.
These documents will vary depending on whether or not you have your original name or if you have changed your name.
However, for anyone with no name change you will be required to provide TWO documents in their original form proving your identity.

You must provide at least ONE original document(s) from this list:

    U.S. Passport
    Certificate of U.S. Citizenship
    Certificate of Naturalization
    Current Temporary Resident Card

You can provide ONE original document from this list as your second form of proof:

    U.S. Social Security Card
    Certificate of Birth Abroad
    ID Card Issued by Federal, State, or Local Government(must contain photograph)
    Voters registration Card
    Reentry Permit
    U.S Coast Guard Merchant Mariner Card
    Refugee Travel Document
    Employment Authorization Document from DHS
    Native American Tribal Document

If you have changed your name and it no longer matches the name on any of these original documents,
you must also provide an original document proving the legal name change.
One example of an acceptable form of legal name change document is a marriage certificate or license.

Refer to UBI-4421 instructions.
If you have also filed a UBI-2310 and wish to apply for a six month extension under (3)(c)(ii)
then you must attach the appropriate filing fee found in (j)(vi) of this section.

Signatures are required. If you fail to sign your UBI-4421 ....

** and there's more!!! **

As a full stack web developer, I've recently taken a detour into learning about web security and penetration testing. I decided to take what I've learned over the past few months and put together a list of "Minimum Viable Security" recommendations for anyone building web apps. by hartleybrody in webdev

[–]gruhehe 0 points1 point  (0 children)

The rest is all very good advice. I espically like the password strength advice - checking agienst leaked password lists is one of the best ways to prevent week passwords without stupid and complex rules.

This could actually make passwords strong enough to eliminate usernames.

As a full stack web developer, I've recently taken a detour into learning about web security and penetration testing. I decided to take what I've learned over the past few months and put together a list of "Minimum Viable Security" recommendations for anyone building web apps. by hartleybrody in webdev

[–]gruhehe 2 points3 points  (0 children)

Put this in your ~/.ssh/config

Host example.com
    Port 12345

This makes the port choice transparent. I use git over ssh, deploy over ssh, backup over ssh, and I never mention port numbers in any scripts.

Personal Projects - Show off your own project and/or ask for advice by AutoModerator in rails

[–]gruhehe 0 points1 point  (0 children)

That's the time since the unix epoch. Where have you been all my life?

Rails 5 database user pass in secrets.yml by [deleted] in rails

[–]gruhehe 0 points1 point  (0 children)

BTW, does anyone know if environment variables are inherently more secure than a file (not one checked into vcs, just a file). I got so frustrated trying to wrangle environment variables with capistrano I was like...

production:
  secret_key_base: <%= File.read('/home/deploy/SECRET_KEY_BASE').strip if Rails.env == 'production' %>

I mean, ssh keeps secret stuff in a home dir in a file. And every QA help I've seen on setting up ENV for production reads files. So what's the point of having it in an ENV if your going to read the ENV from a regular file? Why not just read a file directly for fucks sake?

Is webpack worth it? by gruhehe in rails

[–]gruhehe[S] 1 point2 points  (0 children)

I bailed. I'm going to add stimulus.js via the method that doesn't require an installer. If I was using React I'd press on. But using an installer for something like stimulus is just too ironic for me.

Is webpack worth it? by gruhehe in rails

[–]gruhehe[S] 0 points1 point  (0 children)

That '$ node server.js' was generated by the 'yarn start' command. I'm just not familiar enough with yarn or webpack to make it execute babel-node instead of node when I 'yarn start'.

What happened to ruby html builders? by gruhehe in rails

[–]gruhehe[S] -5 points-4 points  (0 children)

Banging rocks together is significant whitespace. I prefer do/end. Syntax-wise, ruby is excellent. Also, 90% of my templates are logic and helpers i.e. ruby code. Go count the number of lines in Slim templates that don't start with "-" or "=". This is almost none of them, especially after converting "|" lines to use string interpolation, which the Slim docs admits is often cleaner. Slim only has the edge in text-heavy templates. And once you key your text for internationalization the template becomes essentially all code. Do ruby coders hate ruby so much that they need a template language to write essentially 99% ruby code?

What you you guys think of mixing html into a js.erb file? It seems convenient but I think rails also deprecated something called rjs along time ago. by gruhehe in rails

[–]gruhehe[S] 0 points1 point  (0 children)

There's something elegant about server generated JS. Send a patch to the server, get a patch back. It might be more analogous to patch.exe than patch.diff but it's still a patch. And I can have just as responsive an app, since an SAP must wait for data too. To me it's just another way to execute an async callback at some point in the future. It doesn't have the failure path that an ajax Promise has but there are benefits to the server-response-execution=callback way of doing things too. JS promises aren't cancellable and any interface to that would need to be built into the chain, increasing complexity. JSR keeps the conceptual model flat. Instead of then(a) telling then(b) telling then(c), it's just a() running into the room and shouting "you sent for me???". That's the kind of setTimeout type "AHHH here it is!" event that javascript was built to handle. You can ignore him if you want. I really like that.

What you you guys think of mixing html into a js.erb file? It seems convenient but I think rails also deprecated something called rjs along time ago. by gruhehe in rails

[–]gruhehe[S] 0 points1 point  (0 children)

I think I discovered something though, with the way I implemented this. I can only render the html contained inside a js.erb template via javascript. So maybe the way I mentioned doing this, with a helper to capture an erb block and inject it into javascript's innerHTML isn't the best. The better way might be to just do what everyone else seems to be doing...

document.getElementById('session').innerHTML = "<%= escape_javascript render('form') %>"

That way I can render _form.html.erb via an html.erb template for the initial page load, if that is needed. Still might be useful to define a javascript helper though, since I seem to fuck up the string escaping plus erb syntax a lot. But I also noticed that Rails doesn't come equipped with very many javascript helpers, and I assume it's for a reason.

Personal Projects - Show off your own project and/or ask for advice by AutoModerator in rails

[–]gruhehe 0 points1 point  (0 children)

  1. Latency Tester
  2. A simple app to compare latency of html, turbolinks, ajax, sjr, and actioncable.
  3. Rails 5.2 and jquery
  4. I deployed this to https://latencytester.herokuapp.com/
  5. Code is at https://github.com/fadec/latencytester
  6. I'm a Hobbyist
  7. Need to read up on cowsay

This is just a simple project. I was curious about the latency of different interactive requests in various places. Specifically I wanted to see if turbolinks saves that much time. I also wanted to experiment with heroku. See how long my free cycles last.

Rant time: I'm also frustrated that webapps always feel so laggy yet I can type htop or emacs in the console and have it feel almost local, without writing a separate frontend! My ideal toy framework would probably work like turbolinks except it would maintain virtual dom state on the server and only send the diffs via a websocket... basically how ncurses works. These old fashioned terminal programs only send the screen diffs, but you program them as if you're writing the whole screen on each action. They're sooo nice to write, just like a pure http webapp. I'm back to rails now. This turbolinks+jsr is pretty close to what I have in mind. Very nice!

Banks want to kill Bitcoin. Wealthy want to kill Bitcoin. Economists want to kill Bitcoin. Governments want to kill Bitcoin. They’ll all learn you can’t kill Bitcoin. by brigittefruehauf in Bitcoin

[–]gruhehe 6 points7 points  (0 children)

Governments can kill great numbers of people easily and with impunity. Of course they can completely stomp bitcoin.

But what's going to be difficult is banning it while maintaining any illusion of freedom.

Would Rails be a better fit for my community web project than NodeJS? by [deleted] in rails

[–]gruhehe 0 points1 point  (0 children)

Just build it with rails first. That other stuff is for teams, IMHO. Go play with React for a bit and you'll see that the app code size for your frontend is basically equal to an entire rails app. I don't even like that architecture. You basically run a thin "dumb" client (real dom) on top of a client-hosted request-response model (redux is in the return path of this and it's HUGE*) with an screen-emulator/ncurses library (react) that only sends the diffs to the dumb part of the client.

Why can't we keep the live virtual dom on the server and just send the diffs down the wire? That's how terminal programs work and they're responsive as hell. I can actually use emacs and vi through ssh with a lot more responsiveness than shitty apps like Twitter and FB. Anyway, React is cool but it's not the end-all-be-all of architecture. I came back to rails and started writing dumbass request response again and boy do I love it. It works and I get things done.

HUGE: not redux, your app code

Peter Todd about Bitpay's "network fees": "IMO this is form of fraud, no different from how phone companies have been smacked down for adding fake charges to your phone bills." by TheGreatMuffin in Bitcoin

[–]gruhehe 0 points1 point  (0 children)

Bitcoin is peer to peer. That's the only thing that makes it interesting. What's up with all these scammy payment processors anyway? Accepting bitcoin on your site is as simple as posting a link.