Skip to content

u/khamer

In this archive from Jul 2011 to Oct 2023

3
posts
54
comments
1
media
199
score

https://i.imgur.com/aDTnIZi.png

wezterm is one of the few terminals that supports true color, underlines, overlines undercurls, blink, etc. foot is close but doesn't support overlines or undercurls (which is nice for distinguishing spell checking in vim or such.) Alacritty is missing overlines and blink. Kitty is missing italics, blink, and overlines.

wezterm is a solid terminal - I like the configuration and speed - but I wish more terminals had all these more basic features included.

1 points

I did this, switched to pipewire as well, but Firefox it doesn't work at all and Chrome it's unreliable at best. I feel like there's some secret combination of env variables that are supposed to be set or something.

1 points

I appreciate what you're showing, but creating a closure like this should scream you should go create a method. If you were willing to use current time instead of published_at, could a great opportunity to define the setter for slug (setSlugAttribute) but even just a ->makeSlug() or such would be better than this.

14 points

Azure AD was setup; users within the org who needed access to the site were synced to Azure. We got the certificate from Azure, added that (as a dotenv setting) to the laravel site and configured laravel-saml2 to point to the Azure AD endpoint. I believe we also put in an IP whitelist only allow traffic from the website's host to AD.

I added controllers for handling communication with AD and overrode the default Laravel auth control methods to allow for integrating via AD. I don't know if that helps?

2 points

It reminded me of this - https://3v4l.org/YNjsZ

This is also curious - https://3v4l.org/sKEEm

​

It's not adding much functionality, so I can understand why conservative people would oppose it. Plus, in the real world, wouldn't it be better to just pass numbers through something like NumberFormatter, where you could support commas, decimals, spaces, currency, scientific formats, etc.

4 points

I did this for a site that launched about a month ago. We used Azure Active Directory's SAML SSO with Laravel 5.7 and using aacotroneo/laravel-saml2 for authentication. The solution works great, and even plays properly with users who are authenticated automatically by IE/Edge based on their windows login because it just bounces them off of azure's login.

​

The web servers themselves are on Amazon AWS; I have also done a Laravel app behind Azure's builtin stuff too, but I'd say the SAML integration was easier to setup.

1 points

dotenv is meant to read a .env file, and while it can populate $_SERVER or env variables, the point is just to read a configuration file. Laravel uses it to read settings into laravel's own config system - which they document heavily as what people should be using when you're building on Laravel.

If you're using a library like the Amazon SDK, you should ideally pass setting's from laravel's config system to the SDK when you instantiate it in YOUR code (not Laravel's or Amazon's), or if that and all the other Amazon SDK configuration options aren't viable, call putenv() yourself, as Laravel doesn't call putenv() in production and your code won't work there anyway.

1 points

The library already didn't populate env variables in production. It was a side effect of the library as it loaded dotenv for it's own use. If a third party app has a hard dependency on an environment variable being set, you should be setting them in a way that'll work in Laravel's production mode.

​

The problem isn't "fix Laravel" or "fix every third party library", it's "when building a website using both, make sure you use laravel's config when you use a third party library, or make sure you intentionally set the env variables for that library."

2 points

They are retaining that behavior. The only thing that they interfered with is a separate, non-laravel library that depended on a side effect of laravel loading the dotenv in dev mode to get environment variables populated; developers should be intentionally setting env variables if they need to rely on them in production, OR better yet, shouldn't be using env variables for configuring stuff like the Amazon SDK where they provide better options.

1 points
  1. It's not a minor release - Laravel doesn't use SemVer.
  2. Populating system ENV variables is a side effect of Laravel's DEV mode. Laravel uses dotenv to populate it's own config; if you needed get more out of dotenv or do it in production, you have to write your own code.
  3. The Amazon SDK can happily be passed arguments to the constructor, or use an IAM role, or shared credentials, or you can load the environment variables yourself using dotenv, an apache config, or putenv().
2 points

For the number of attackers going after the ability to compromise ~30% of all sites, the core pretty rarely is the issue. Honestly, the only way I'd see attacks go down significantly would be to force limited login attempts or 2FA on all users. After that, maybe a way to differentiate which plugins have gone through testing and which haven't.

As far as support PHP 5.x - while I'm sure that adds some risks, isn't that more the fault of the web host that's not keeping their servers up to date? WordPress could force that to happen with an update, but ultimately it's the web host's responsibility to make sure they're providing secure hosting.

2 points

WordPress is for people who need to manage a site but aren't interested in doing it; it's for people whose real job is marketing, sales, or IT, and the website is just something they have to deal with to get their job done.

4 points

My algorithm would be more like:

  1. Do you want to be a 'power user' of your shell: if yes, bash or zsh. If no, fish.
  2. Do you want to learn the shell that'll be available on every mac/linux computer/server you ever touch? If yes, bash. If no, zsh or fish.

Nothing against zsh either, but you can do nearly all the things people do with zsh with bash, they're just less obvious. There's a bunch of bash shell options IMO should be on by default.

0 points
function controllerFunctionGet() {
    $what = [
        'stuff' => $this->service->things(),
    ];
    $what['more'] = $this->service->more($what['stuff']);

    return $what;
}

Personally I'd probably be more likely to write this:

function controllerFunctionGet() {
    $things = $this->service->things();
    return [
        'stuff' => $things,
        'more' => $this->service->more($things),
    ];
}

or maybe add a method to $this->service:

function thingsAndMore() {
    $things = $this->things();
    return [
        'stuff' => $things,
        'more' => $this->more($things),
    ];
}

function controllerFunctionGet() {
    return $this->service->thingsAndMore();
}

There's always ways.

1 points

Answering your question - Jeffrey says you're better off starting new projects with Mix, and he only intends to do minimal fixes and no real development on Elixir (I know he mentions this in the last episode or two of the Laravel podcast.)

I know this contradicts Examo, but Laravel Mix is the simpler tool; webpack is simpler than Gulp/Elixir and has a lot less moving pieces, and is much better cut out for simple tasks like you described.

I'd only stick with gulp if you needed to write more sophisticated tasks than what webpack can do well.

And just to point it out, merging JS is one line:

mix.js(['one.js', 'two.js'], 'merged.js');

And compiling sass is one line:

mix.sass('resources/assets/sass/app.sass', 'public/css');

webpack's file watching seems more reliable than gulp's, webpack seems to compile faster and it seems to do a better job of compiling just the affected files than gulp did.

If you need to write any custom monitoring, SFTP uploading, generate docs, or other stuff like that you probably want gulp/elixir instead.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.