No Place to Place: Inside China’s Bicycle Graveyards

https://theawesomer.com/photos/2023/06/no_place_to_place_china_bike_graveyards_t.jpg

No Place to Place: Inside China’s Bicycle Graveyards

Link

With over 1.4 billion people, China generates a lot of waste. In 2017, it created a new problem. After shared bicycle programs cluttered streets with more than 25 million bikes, the government enforced fleet size limits, and countless bikes ended up in massive graveyards. Guoyong Wu’s short film uses aerial photography to show just how big the problem got.

The Awesomer

Laravel File Uploads: Save Filename in DB with Folder and URL?

https://laraveldaily.com/storage/423/Copy-of-Copy-of-ModelpreventLazyLoading();-(6).png

When uploading files with Laravel, how to store the filename in the DB? Should you store filename.png? Or, include the folder of avatars/filename.png? Or, the full path https://website.com/avatars/filename.png? Let me tell you my opinion.

This tutorial will have an avatar field on the register page and an avatar column in the users table. Let’s see how we can save it.


The easiest way is to store just the filename and create a separate storage disk.

config/filesystems.php:

return [

 

// ...

 

'disks' => [

 

// ...

 

'avatars' => [

'driver' => 'local',

'root' => storage_path('app/public/avatars'),

'url' => env('APP_URL').'/storage/avatars',

'visibility' => 'public',

'throw' => false,

],

 

],

 

// ...

 

];

Then, when storing the file we need to specify the new avatars disk.

app/Http/Controllers/Auth/RegisteredUserController.php:

class RegisteredUserController extends Controller

{

// ...

 

public function store(Request $request): RedirectResponse

{

$request->validate([

'name' => ['required', 'string', 'max:255'],

'email' => ['required', 'string', 'email', 'max:255', 'unique:'.User::class],

'password' => ['required', 'confirmed', Rules\Password::defaults()],

'avatar' => ['nullable', 'image'],

]);

 

if ($request->hasFile('avatar')) {

$avatar = $request->file('avatar')->store(options: 'avatars');

}

 

$user = User::create([

'name' => $request->name,

'email' => $request->email,

'password' => Hash::make($request->password),

'avatar' => $avatar ?? null,

]);

 

// ...

}

}

This way, your full URL filename https://website.com/storage/avatars/filename.png consists of three things:

  • Domain: https://website.com is stored in your APP_URL in .env file: so it is flexibly different for your local and production servers
  • Folder: /storage/avatars is in the config('disks.avatars.url') which corresponds to the internal structure of /storage/app/public/avatars described in the same config file. Both also can be flexibly changed if needed.
  • Filename: filename.png is the only thing actually landing in the DB column

To get the URL for the image in the Blade file, we would use URL method on the Storage facade providing the disk.

<img src="" alt="" />

But what if, after some time, you would need to go from local disks to, let’s say, Amazon S3?

The only change you would need to make is to change the disk, and maybe instead of the url, use the temporaryUrl method to provide the expiration time for the link.

<img src="" alt="" />

Laravel News Links

How A 120mm Tank Round Works

http://img.youtube.com/vi/gJz8cVUvYws/0.jpg

Here’s something informational for Sunday, Nicholas Moran explaining exactly how a modern 120mm (AKA 120×570mm NATO, the type used by the M1A2 Abrams and the German Leopard 2) APFSDS round works.

  • He has a dummy blue round to demonstrate the features. “All the projectiles are color coded. Explosive, for example, would be green with yellow lettering.” APFSDS rounds are black.
  • “The aft cap is the one piece which is left behind after a modern round is fired, and this takes up a lot less room than a traditional shell casing rattling around inside the tank once you fire it.”
  • A long primer rod runs up the middle for more even propellent burning.
  • “A modern tank does have a firing pin. It’s electrically fired, but it has a firing pin. It looks just like a firing pin you’d expect from a rifle, except it’s about yay long…Electricity goes through the firing pin, sets off the primer, which sets off the propellant, which gives you
    the big boom.”

  • There are even emergency hand crank firing systems with dynamos to use if the electrical system goes down.
  • “The rest of the shell casing is made of a form of cellulose, and it is burned up in the explosion. So the aft cap is sufficient to seal the breach instead of requiring the entire casing to expand as you you’d find on a traditional round.”
  • “The catch is that this is simply not as robust as a metal shell.” Which is why the loader has to inspect rounds for scratches or bulges to the water-resistant coating. That could cause the round to break apart or misfire. “This is a bad thing.”
  • Which is why tank crews practice misfire drills to ensure safe handling of rounds so they don’t spread loose propellant all over the tank’s interior.
  • “The kinetic energy penetrator is itself a dart… it’s got fins at the back to keep the pointy end forwards, and it is kept centered as it goes down the tube by these sabot petals.”
  • “Modern sabots seem to have settled on three of these petals per projectile. Once the projectile has left the muzzle, the air is caught by the petals and they are peeled away.”
  • The discarded petals are a danger. “This is why sabot rounds such as APFSDS or M-PT should not be fired over the heads of friendly infantry.”
  • “The dart goes that way, hits metal, and basically punches through, taking little bits of metal inside with them. This is called a spall. These little fragments metal are extremely unhealthy to anyone or anything inside the vehicle which it hits.”
  • “However, if the armor is too thin to produce spalling, you get what is known as over-penetration. So you make a dart-sized hole on one side of the vehicle, a dart-sized hole on the far side of the vehicle, and dart sized holes on anything in-between, and outside of brown pants for the crewmen, quite possibly nothing else.”
  • “If so you’re firing such a target, you’re probably better off using a shaped charge round such as HEAT.”
  • He then show off a dummy HEAT projector, which has a funky blunt circular head that “in effect clears the air as a wind shield for the decidedly non-aerodynamic flat bit. The main body of the round also performs something of a stabilizing function and thirdly provides adequate standoff or room for the penetrating jet to form.”
  • “Here is a metal cone surrounded by explosives. The explosives detonate, the cone collapses the liner.”
  • Text popped up on screen at 9 minutes in notes that the penetrating jet is not high temperature plasma.
  • Here’s another video that provides a visualized simulation of how APFSDS rounds work.

    Lawrence Person’s BattleSwarm Blog

    South Korean dude rejects being called racist for hating Little Mermaid: “You keep asking us to watch sh*tty movies”

    https://www.louderwithcrowder.com/media-library/why-is-little-mermaid-bombing-in-south-korea.png?id=34131336&width=980

    Allow me to admit up front I could be jumping to conclusions. There is a story in the news about a raaaaacist backlash to Disney’s The Little Mermaid. A video of a based South Korean chad is going viral being asked about a raaaaacist backlash to a movie. Perhaps he’s being asked about a raaaaacist backlash to a different movie? If that is the case, allowed me to apologize on behalf of all of us here at the Louder with Crowder Dot Com website.

    Now check out my man here.

    That’s nonsense. So you keep asking us to watch the sh*tty movies you make, right? Why do we have to watch them? This has nothing to do with racism, alright? You make a weird movie, and if we don’t watch it because we don’t agree with your agenda, it’s like they’re trying to lecture us, asking "Why don’t you agree?’ But who are they to lecture anyone?"

    Hell yeah, brother. You have now become the second most based Asian on all of the Internets. Shout out to #1:

    The "Western media" in question could be Western journalisming content creators CNN. They posted a piece of content titled "‘The Little Mermaid’ tanks in China and South Korea amid racist backlash from some viewers." The CNN blogger who created the content points out that while having a black Ariel has been "celebrated elsewhere" (like in America, and in… America), a handful of cherry-picked Asian cinephiles disagree with the casting choice.

    In the case of South Korea, CNN cites one single person who expressed disappointment on Instagram.

    [The Little Mermaid] brought in just 19.5 million yuan ($2.7 million) in its first five days, compared with 142 million yuan (nearly $20 million) for “Spider-Man: Across the Spider-Verse” in the first five days of that film’s opening, according to Chinese box office tracker Endata.

    Similar sentiment was found on social media in South Korea. On Instagram, one user wrote that the movie had been “ruined” for them, adding “#NotMyAriel.”

    Right. It could be raaaaacist backlash. Or, your movie can get just suck. The Spider-Man: Across the Spider-Verse movie that has made at least five times more money? The lead character has brown skin and the leading lady may or may not be trans.

    There are two things at play here. The first is that Hollywood makes movies counting on the Asian market to make them their money. It’s why John Cena had to cuck himself for saying the word "Taiwan." If a movie doesn’t do well overseas, it’s a global failure.

    This brings us to point number two. In the woke progressive hive mind, nothing is ever their fault when normies reject the Left pushing an agenda. It can only be the fault of an -ism or a -phobia. It started with the girl Ghostbuster movie in 2016, which looked like a bucket of sh*t from the first trailer. When moviegoers decided not to spend their money on a bucket of sh*t, filmmakers lashed out at the audience. A single YouTube comment from someone who said "the movie ruined their childhood" was used in the marketing to shame people into seeing the movie if they didn’t want to be labeled an -ist.

    If you make movies that don’t look like they suck, people will spend money to go see your movie. This isn’t something that needs to be explained.

    ><><><><><><

    Brodigan is Grand Poobah of this here website and when he isn’t writing words about things enjoys day drinking, pro-wrestling, and country music. You can find him on the Twitter too.

    Facebook doesn’t want you reading this post or any others lately. Their algorithm hides our stories and shenanigans as best it can. The best way to stick it to Zuckerface? Bookmark LouderWithCrowder.com and check us out throughout the day! Also, follow us on Instagram and Twitter.

    Louder With Crowder