13 September, 2024
Laravel Herd Adds Forge Integration, Dump Updates, and More in v1.11
Programing Coderfunda
September 13, 2024
No comments
Laravel Herd released v1.11 this week, a significant update that includes Laravel Forge integration, sharing Herd project configuration across a team, a convenient profiler integration, and more:
Laravel Herd v1.11 Main Features
*
Forge Integration - Integrate directly with Forge and deploy applications via the UI
*
Share Configuration With Your Team - share project configuration via a Herd.yml file
*
Profiler - profile applications with the SPX profiler using herd profile
*
Reverb TLS Support - Reverb TLS support with the click of a checkbox
*
Dump UI Improvements - Dump queries, HTTP requests, logs, and more directly in Herd
Forge Integration
Herd now has direct integration with Laravel Forge, enabling you to deploy your site directly from Herd, open an SSH connection on the server, or even open your site on forge.laravel.com. Head over to the documentation to learn more!
Sharing Configuration With Herd.yml
With Herd v1.11, you can share project configuration with your team using a Herd.yml file in the root of your project. You can configure the project name, domain aliases, PHP version, and SSL certificates.
You set up the Herd.yml using the herd init command. If your project doesn't have the file, the init command prompts you through the setup process. Pro users can also define services in the Herd.yml file.
When a new developer clones your project, running herd init will get them up and running immediately, and all developers will have the same setup. Projects can configure the Forge server and site IDs to share site configurations with all developers.
Check out the Herd documentation to learn all about Sharing project configurations.
The Herd v1.11 update is available immediately on macOS, with the Windows release happening soon.
Profiler
Herd v1.11 has a new profiler for identifying performance issues in your code. Herd makes profile requests, CLI scripts, and long-running tasks seamless.
Profiler example from the Herd documentation
Here's an example of profiling Artisan commands via the Herd CLI:
herd profile artisan my-command
Dump UI Improvements
Herd's dump debugging features a new custom PHP extension that makes using dd() and dump() automatic. You can also configure Herd to dump queries, HTTP requests, views, jobs, and logs.
Learn More
You can learn more about Herd's features in the official documentation.
The post Laravel Herd Adds Forge Integration, Dump Updates, and More in v1.11 appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
What’s New in Laravel 11.23: A Summary
Programing Coderfunda
September 13, 2024
No comments
12 September, 2024
Excel VBA Selecting the files xxx_Before.log then xxx_After.log
Programing Coderfunda
September 12, 2024
No comments
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Filters.Add "Log Files", "*.log", 1
If .Show = -1 Then
FullPath = .SelectedItems.Item(1) 'selected text file full path
End If
End With
If FullPath = "" Then Exit Sub 'if Cancel pressed, the code stops
textFileLocation = Left(FullPath, InStrRev(FullPath, "\") - 1)
fileName = Dir(textFileLocation & "\*.log") 'first text file name
fileDate = Format(FileDateTime(textFileLocation), "mm/dd/yyyy")
If fileName "" Then
Do While fileName "" 'loop since there still are not processed text files
'Get File Name
sFullFilename = Right(fileName, Len(fileName) - InStrRev(fileName, "\"))
sFileName = Left(sFullFilename, (InStr(sFullFilename, ".") - 1))
'place the content of the text file in an array (split by VbCrLf):
arrTxt = Split(CreateObject("Scripting.FileSystemObject").OpenTextFile(textFileLocation & "\" & fileName, 1).ReadAll, vbCrLf)
lastR = ws.Range("A" & ws.Rows.Count).End(xlUp).Row 'the row where to paste the array content
'drop the transposed array content:
ws.Range("A" & IIf(lastR = 1, lastR, lastR + 1)).Resize(UBound(arrTxt) + 1, 1).Value = Application.Transpose(arrTxt)
'apply TextToColumns to whole returned data:
ws.Columns(1).TextToColumns Destination:=ws.Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(43, 1), Array(70, 1)), TrailingMinusNumbers:=True
✅ Command Validator: validate the input of console commands
Programing Coderfunda
September 12, 2024
No comments
https://github.com/cerbero90/command-validator
The validation of our command arguments and options is just one trait away! 🙌
https://preview.redd.it/018z0tn9pfod1.png?width=1748&format=png&auto=webp&s=e523f7bd24f8c4b94c9a08b1f19a383a699982cb submitted by /u/cerbero90
[link] [comments]
Invalid Grant Error with MSAL in Next.js - Insufficient Permissions (AADB2C90205)
Programing Coderfunda
September 12, 2024
No comments
{
"error": "invalid_grant",
"error_description": "AADB2C90205:This application does not have sufficient permissions
against this web resource to perform the operation.
\r\nCorrelation ID: 425d0c39-3bf7-48be-9b81-8bc5cd5abc02\r\nTimestamp: 2024-09-06 12:41:31Z\r\n"
}
Here are the relevant details:
@azure/msal-browser: ^3.23.0
@azure/msal-react: ^2.0.13
I am using Azure AD B2C to handle user authentication.
Steps Taken:
I registered the application in Azure AD B2C.
Configured the necessary redirect URIs and API permissions.
Set up the MSAL configuration in my Next.js app using the MSAL React library.
Troubleshooting Attempts:
Checked API permissions and made sure they were granted admin consent.
Verified that the redirect URIs and scopes in my MSAL configuration match those in Azure AD B2C.
Question: What might be causing this "insufficient permissions" error, and how can I resolve it? Is there something specific I need to configure in Azure AD B2C for MSAL to successfully authenticate users?
Any help would be appreciated!
Laracon US Keynote Framework Updates Are Now In Laravel 11.23
Programing Coderfunda
September 12, 2024
No comments
The Laravel team released v11.23 this week, with the Laracon US 2024 open-source updates like defer(), concurrency, contextual container attritubes, and more.
Laracon 2024 Updates
Taylor Otwell contributed all of the goodies he shared in his Laracon US 2024 keynote, including chaperone(), defer(), Cache::flexible(), contextual container attributes, and more.
The documentation is being updated; here are a few highlights you should check out to get familiar with these updates:
*
Concurrency Documentation
*
Container Contextual Attributes
*
Automatically Hydrating Parent Models on Children (AKA chaperone())
*
Helpers: Deferred Functions
See Pull Request #52710 for full details on everything added related to Taylor's .
Add minRatio and maxRatio Rules to Dimension Validation
Cam Kemshal-Bell added min and max ratio to the dimensions validation rule:
You can use these methods fluently, using minRatio(), maxRatio(), and ratioBetween():
use Illuminate\Validation\Rule;
//
// Using minRatio and maxRatio fluent methods
//
Rule::dimensions()
->minRatio(1 / 2)
->maxRatio(1 / 3);
// dimensions:min_ratio=0.5,max_ratio=0.33333333333333
//
// Equivalent using ratioBetween()
//
Rule::dimensions()->ratioBetween(min: 1 / 2, max: 1 / 3);
// dimensions:min_ratio=0.5,max_ratio=0.33333333333333
You can also use the string style dimensions rule with this update as well:
use Illuminate\Support\Facades\Validator;
Validator::make($request->all(), [
'min_12' => 'dimensions:min_ratio=1/2',
'square' => 'dimensions:ratio=1',
'max_25' => 'dimensions:max_ratio=2/5',
'min_max' => 'dimensions:min_ratio=1/4,max_ratio=2/5',
]);
Backed Enum Support in Gate Methods and Authorize Middleware
Diaa Fares contributed two pull requests that continue to add backed enum support. This release includes updates to the Gate methods and Authorize middleware.
Here are some examples of using Enums with Gate methods:
enum Abilities: string {
case VIEW_DASHBOARD = 'view-dashboard';
case EDIT = 'edit';
case UPDATE = 'update';
}
// Before
Gate::define('view-dashboard', function (User $user) {
return $user->isAdmin;
});
Gate::authorize('view-dashboard');
Gate::inspect('view-dashboard');
Gate::check('view-dashboard');
Gate::any(['edit', 'update], $post);
Gate::none(['edit', 'update]], $post);
Gate::allows('update', $post);
Gate::denies('update', $post);
// After
Gate::define(Abilities::VIEW_DASHBOARD, function (User $user) {
return $user->isAdmin;
});
Gate::authorize(Abilities::VIEW_DASHBOARD);
Gate::inspect(Abilities::VIEW_DASHBOARD);
Gate::check(Abilities::VIEW_DASHBOARD);
Gate::any([Abilities::EDIT, Abilities::UPDATE], $post);
Gate::none([Abilities::EDIT, Abilities::UPDATE], $post);
Gate::allows(Abilities::UPDATE, $post);
Gate::denies(Abilities::UPDATE, $post);
Here's an example of the Authorize middleware's support for backed enums:
Route::get('/dashboard', [AdminDashboardController::class, 'index'])
->middleware(
Authorize::using(Abilities::VIEW_DASHBOARD)
)
->name(AdminRoutes::DASHBOARD);
Skip Middleware for Queue Jobs
Kennedy Tedesco contributed a Skip middleware to skip a job based on a condition. This middleware has three static constructor methods you can use, including when(), unless(). The job is skipped based on the result of the condition used:
class MyJob implements ShouldQueue
{
use Queueable;
public function handle(): void
{
// TODO
}
public function middleware(): array
{
return [
Skip::when($someCondition), // Skip when `true`
Skip::unless($someCondition), // Skip when `false`
Skip::when(function(): bool {
if ($someCondition) {
return true;
}
return false;
}),
];
}
}
Eloquent Collection findOrFail() Method
Steve Bauman contributed a findOrFail() method on Eloquent collections that adds a way to find a model on an already populated collection:
$users = User::get(); // [User(id: 1), User(id: 2)]
$users->findOrFail(1); // User
$user->findOrFail([]); // []
$user->findOrFail([1, 2]); // [User, User]
$user->findOrFail(3); // ModelNotFoundException: 'No query results for model [User] 3'
$user->findOrFail([1, 2, 3]); // ModelNotFoundException: 'No query results for model [User] 3'
Release notes
You can see the complete list of new features and updates below and the diff between 11.22.0 and 11.23.0 on GitHub. The following release notes are directly from the changelog:
v11.23.0
* [11.x] Fix $fail closure type in docblocks for validation rules by @bastien-phi in
https://github.com/laravel/framework/pull/52644
/>
* [11.x] Add MSSQL 2017 and PGSQL 10 builds by @driesvints in
https://github.com/laravel/framework/pull/52631
/>
* Update everyThirtyMinutes cron expression by @SamuelNitsche in
https://github.com/laravel/framework/pull/52662
/>
* Bump micromatch from 4.0.5 to 4.0.8 in /src/Illuminate/Foundation/resources/exceptions/renderer by @dependabot in
https://github.com/laravel/framework/pull/52664
/>
* [11.x] apply excludeUnvalidatedArrayKeys to list validation by @lorenzolosa in
https://github.com/laravel/framework/pull/52658
/>
* [11.x] Adding minRatio & maxRatio rules on Dimension validation ruleset by @CamKem in
https://github.com/laravel/framework/pull/52482
/>
* [11.x] Add BackedEnum support to Authorize middleware by @diaafares in
https://github.com/laravel/framework/pull/52679
/>
* [11.x] Add BackedEnum support to Gate methods by @diaafares in
https://github.com/laravel/framework/pull/52677
/>
* [11.x] Suggest serializable-closure by @driesvints in
https://github.com/laravel/framework/pull/52673
/>
* [11.x] Fix alter table expressions on SQLite by @hafezdivandari in
https://github.com/laravel/framework/pull/52678
/>
* [11.x] Add Exceptions\Handler::mapLogLevel(...) so the logic can be easily overridden by @taka-oyama in
https://github.com/laravel/framework/pull/52666
/>
* [11.x] Bugfix for calling pluck() on chaperoned relations. by @samlev in
https://github.com/laravel/framework/pull/52680
/>
* [11.x] Fix build failures due to enum collide After adding BackedEnum support to Gate by @diaafares in
https://github.com/laravel/framework/pull/52683
/>
* Fixing Str::trim to remove the default trim/ltrim/rtim characters " \n\r\t\v\0" by @mathiasgrimm in
https://github.com/laravel/framework/pull/52684
/>
* [11.x] Add Skip middleware for Queue Jobs by @KennedyTedesco in
https://github.com/laravel/framework/pull/52645
/>
* [11.x] Fix etag headers for binary file responses by @wouterrutgers in
https://github.com/laravel/framework/pull/52705
/>
* [11.x] add withoutDelay() to PendingDispatch by @KennedyTedesco in
https://github.com/laravel/framework/pull/52696
/>
* [11.x] Refactor Container::getInstance() to use null coalescing assignment by @xurshudyan in
https://github.com/laravel/framework/pull/52693
/>
* [11.x] Removed unnecessary call to setAccessible(true) by @xurshudyan in
https://github.com/laravel/framework/pull/52691
/>
* [11.x] Add Eloquent\Collection::findOrFail by @stevebauman in
https://github.com/laravel/framework/pull/52690
/>
* [11.x] PHPStan Improvements by @crynobone in
https://github.com/laravel/framework/pull/52712
/>
* [11.x] Fix Collection PHPDoc by @staudenmeir in
https://github.com/laravel/framework/pull/52724
/>
* [11.x] Add optional parameter for confirmed validator rule by @jwpage in
https://github.com/laravel/framework/pull/52722
/>
* [11.x] Test Improvements by @crynobone in
https://github.com/laravel/framework/pull/52718
/>
* [11.x] Fix incorrect variable-length argument $guards from array to string by @kayw-geek in
https://github.com/laravel/framework/pull/52719
/>
* Allow testing of relative signed routes by @shealavington in
https://github.com/laravel/framework/pull/52726
/>
* [11.x] fix: Builder::with closure types by @calebdw in
https://github.com/laravel/framework/pull/52729
/>
* Laracon 2024 by @taylorotwell in
https://github.com/laravel/framework/pull/52710
/>
* Add Tag attribute by @TijmenWierenga in
https://github.com/laravel/framework/pull/52743
/>
* [11.x] Adds BackedEnum to PendingDispatch's phpDoc for onQueue, allOnQueue, onConnection, allOnConnection methods by @sethsandaru in
https://github.com/laravel/framework/pull/52739
/>
* New when() helper. by @danmatthews in
https://github.com/laravel/framework/pull/52665
/>
* [11.x] Add fromUrl() to Attachment by @KennedyTedesco in
https://github.com/laravel/framework/pull/52688
/>
The post Laracon US Keynote Framework Updates Are Now In Laravel 11.23 appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
Getting Authentication error when connecting to another private repo from the github actions workflow
Programing Coderfunda
September 12, 2024
No comments
terraform:
runs-on: self-hosted
needs: determine_scope
if: needs.determine_scope.outputs.deploy == 'yes'
environment: ${{ inputs.environment }}
env:
TF_VAR_snowflake_account: ${{ vars.SNOWFLAKE_ACCOUNT }}
TF_VAR_snowflake_username: ${{ vars.SNOWFLAKE_USERNAME }}
TF_VAR_snowflake_role: ${{ vars.SNOWFLAKE_ROLE }}
TF_VAR_snowflake_private_key_passphrase: ${{ secrets.SNOWFLAKE_PASSPHRASE }}
TF_VAR_snowflake_private_key: ${{ secrets.SNOWFLAKE_PRIVATE_KEY }}
defaults:
run:
working-directory: ${{ inputs.path }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.AZ_CREDENTIALS }}
- name: JSON Parse
id: parse
env:
AZJSON: ${{ secrets.AZ_CREDENTIALS }}
run: |
ARM_CLIENT_ID=$(echo $AZJSON | jq -r '.["clientId"]')
ARM_CLIENT_SECRET=$(echo $AZJSON | jq -r '.["clientSecret"]')
ARM_TENANT_ID=$(echo $AZJSON | jq -r '.["tenantId"]')
ARM_SUBSCRIPTION_ID=$(echo $AZJSON | jq -r '.["subscriptionId"]')
echo ARM_CLIENT_ID=$ARM_CLIENT_ID >> $GITHUB_ENV
echo ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET >> $GITHUB_ENV
echo ARM_TENANT_ID=$ARM_TENANT_ID >> $GITHUB_ENV
echo ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID >> $GITHUB_ENV
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: latest
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Configure Git Credentials
run: |
git config --global credential.helper store
echo "
https://x-access-token:${{ secrets.GIT_PAT }}@github.com" > ~/.git-credentials
env:
GIT_PAT: ${{ secrets.GIT_PAT }}
- name: Terraform Init
run: terraform init -backend-config="${{ inputs.backend_config }}"
error:
You said:
I'm getting this error in terraform init
│ Error: Failed to download module
│
│ on main.tf line 124:
│ 124: module "tag_associations" ***
│
│ Could not download module "tag_associations" (main.tf:124) source code from
│ "git::
https://github.com/g/platform-terraform.git?ref=main":
/> │ error downloading
│ '
https://github.com/g/platform-terraform.git?ref=main':
/> │ /usr/bin/git exited with 128: Cloning into
│ '.terraform/modules/tag_associations'...
│ remote: Invalid username or password.
│ fatal: Authentication failed for
│ '
https://github.com/g/platform-terraform.git/'
/>
When I use the github hosted runner (ubuntu-latest) it works fine. But when usig the self-hosted runner. it throws above error
11 September, 2024
how can I integrate continuous data and static data using random forest machine learning model?
Programing Coderfunda
September 11, 2024
No comments
I got a prediction but the problem in feature importance the model gave high importance to static inputs and no importance for continuous inputs which is wrong. how can I fix this?
Spring boot app (error: method getFirst()) failed to run at local machine, but can run on server
Programing Coderfunda
September 11, 2024
No comments
I read Compilation error on List.getFirst(): cannot find symbol?
The answer stated the issue caused by the different java version of the online server and the local machine. But I checked they both used java 21.
Error message
JSONWebMvcConfigurer.java:
java: cannot find symbol
symbol: method addFirst(com.alibaba.fastjson2.support.spring6.http.converter.FastJsonHttpMessageConverter)
location: variable converters of type java.util.List
VS Code feels less
Programing Coderfunda
September 11, 2024
No comments
* PHPStorm Laravel Idea is a paid plugin :( Yes I know 30 days for free. I've been doing that for years now.
* PHPStorm is slow, bulky and takes a lot of Memory.
and several, but not limited to, VS Code reasons:
* It's fast.
* You can spawn cursors w/o switching to some column mode.
* Template shortcuts like "nav.w-full.bg-ping-600".
* Developers tend to use it and if I see video explaining or showing examples, nice to see the same editor.
* A lot of customization and tuning is possible.
How it's going you might ask?
Not easy. It's a nightmare some would say.
* I had to google and install a lot of Extensions. Then I had to deal with errors from said Extensions. Uninstall some of them. Then maybe install a couple back. I uninstalled a pack extensions and that removed all said extensions. I still don't know if I have all Laravel/Vue extensions and if I might need to change them later because of a different project... So many unknowns, where's the PHPStorm you just install and use. That's it.
* Quick fix is not working. Even after installing Volar, ESLint or Laravel extensions and going through all the settings the OpenAI suggested. Not Vuejs, not Laravel quick fix is working. Insane.
* In VSCode/Laravel project you can move or rename a file and nothing will be updated.
* I'm missing a PHPStorm panel where you could double-tap a ctrl and have a list of commands to execute in the terminal.
* VSCode does not have scratch files. Installed an Extensions. That doesn't work either.
* Missing the Laravel Idea make form for Models, Controllers, etc. I now have to either answer a lot of questions from Command Palette or run it manually from the terminal.
* If I ctrl-click "UserController@update" from the terminal, that doesn't work either. I have to delete the @\update to open the UserController.php file.
* PHPStorm has a very nice open modal: Open Class, Open fiile, actions, etc. I can't open a PHP class in VSCode.
* PHPStorm has a Local History modal, where I can go back in time while editing file and maybe re-do something or copy old code.
* I think I forgot a couple issues while writing this but I will end this rant by saying PHPStorm had all configurations in one place. I could configure and run php serve, npm dev, debug, etc all in 1 place. VSCode depends on extensions and whether they add commands to Command Palette.
Atm bootstrapping a full-stack developer to a VSCode feels challenging. Not to mention there's people who won't bother going through configuration or troubleshooting for VSCode. They would simply install PHPStorm and start using it. That's my friend. He's an iphone user. submitted by /u/darknmy
[link] [comments]
How to Not Turn Your Laravel App into a Circus
Programing Coderfunda
September 11, 2024
No comments
Lazy JSON Pages: scrape any JSON API in a memory-efficient way
Programing Coderfunda
September 11, 2024
No comments
Scrape literally any JSON API in a memory-efficient way by loading each paginated item one-by-one into a lazy collection 🍃
While being framework-agnostic, Lazy JSON Pages plays nicely with Laravel and Symfony 💞
https://github.com/cerbero90/lazy-json-pages
https://preview.redd.it/c7853u6ec3od1.png?width=2244&format=png&auto=webp&s=08d5394aefaf2058af278de631722bccabc24f03
https://preview.redd.it/dv5jmu6ec3od1.png?width=2096&format=png&auto=webp&s=c648dcc639f393d7bd8c0035b2f12ae13dd9450e
https://preview.redd.it/tm6b7v6ec3od1.png?width=1852&format=png&auto=webp&s=d5c55c167de093ac98aaf38e376cf7fed1f60f65
https://preview.redd.it/vkrl5u6ec3od1.png?width=2056&format=png&auto=webp&s=1d6513c44251e4d0684e77199a8879d093cab0d9 submitted by /u/cerbero90
[link] [comments]
10 September, 2024
Truncating Production Tables Live On Stage with Verbs (Daniel Coulbourne)
Programing Coderfunda
September 10, 2024
No comments
error when trying to join many upset plots in only one plot using grid.arrange in r
Programing Coderfunda
September 10, 2024
No comments
grid.arrange(plot1, plot2)
it gives this error:
Error in gList(...): only 'grobs' allowed in 'gList'
I think this is happening because the plot is an 'upset' class, I tried to transform them into a ggplot using ggplotGrob() but it gives:
Error in UseMethod("ggplot_build"): no applicable method for 'ggplot_build' applied to an object of class upset"
pip install itself fails with "No module named 'distutils'"
Programing Coderfunda
September 10, 2024
No comments
Are `elf.h` structures packed?
Programing Coderfunda
September 10, 2024
No comments
All data structures that the file format defines follow the
"natural" size and alignment guidelines for the relevant class.
If necessary, data structures contain explicit padding to ensure
4-byte alignment for 4-byte objects, to force structure sizes to
a multiple of 4, and so on.
But since aligment is implementation defined I imagine that is not a good
pratice suppose that the structures are allways packed.
For example, the following (pseudocode) can falls in some systems/compilers:
unsigned char e_ident[EI_NIDENT]; // Supposing that sizeof(unsigned char) == sizeof(uint8_t)
Elf32_Ehdr *ehdr;
// First read the e_ident
fread(e_ident, EI_NIDENT, 1, file_ptr);
// Now read the ELF header
if(e_ident[EI_CLASS] == ELFCLASS32){
ehdr = malloc(sizeof(Elf32_Ehdr));
memcpy(ehdr->e_ident, e_ident, EI_NIDENT);
fread(&(ehdr->e_type), sizeof(uint8_t), sizeof(Elf32_Ehdr) - (size_t)EI_NIDENT, file_ptr);
}
On negative answer for the main question, there is some portable way to ensure that elf.h structures are packed?
NOTE: I'm using the elf.h from musl.
API WOOCOMERCE (INSERT PRODUCT) - Whitespace on attributes (options)
Programing Coderfunda
September 10, 2024
No comments
I'm uploading a product via api rest v3.
I have the problem loading attribute options
If I use a space option, it separates the terms.
If Gravina Di Catania loads, Gravina takes me then Di and then Catania
If I do the test on postman everything is ok
If I make the call via Php no.
how do i fix it?
I put double quotes in the string.
I used addslashes
i tried doing JSON ENCODE of options array
09 September, 2024
Does it cost money to read from aws s3 in Python?
Programing Coderfunda
September 09, 2024
No comments
* Using s3fs to read a file
import s3fs
s3 = s3fs.S3FileSystem()
path = "s3://my-bucket/foo/bar.txt"
text = s3.read_text(path)
* Using s3fs to glob for files
import s3fs
s3 = s3fs.S3FileSystem()
bar = "s3://my-bucket/foo/*"
my_paths = s3.glob(bar)
* Reading a file with pandas
import pandas as pd
path = "s3://my-bucket/foo/bar.csv"
my_df = pd.read_csv(path)
Is someone getting charged money when I do any of these three things?
Don't undo what you haven't done. Avoid this subtle, but insidious little bug.
Programing Coderfunda
September 09, 2024
No comments
Pest v3 Now Available
Programing Coderfunda
September 09, 2024
No comments
Laravel Password Hashing With Salt
Programing Coderfunda
September 09, 2024
No comments
Theo (t3dotgg) rage-baiting about Laravel without reading the docs
Programing Coderfunda
September 09, 2024
No comments
https://t.co/l6yEb3qd50" / X
Okay so I watched his stream regarding Laravel, and he didn't put much effort to read the docs other than installation page and is already spreading negativity on Twitter/X regarding Laravel.
Any thoughts? Is Laravel docs that confusing for a beginner? submitted by /u/TastyInternet
[link] [comments]
08 September, 2024
Weekly /r/Laravel Help Thread
Programing Coderfunda
September 08, 2024
No comments
* What steps have you taken so far?
* What have you tried from the documentation?
* Did you provide any error messages you are getting?
* Are you able to provide instructions to replicate the issue?
* Did you provide a code example?
* Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the /r/Laravel community! submitted by /u/AutoModerator
[link] [comments]
nextjs google sign in
Programing Coderfunda
September 08, 2024
No comments
right now I'm using nextAuth with a simple sign in to google, the process is opening console.cloud.google, and doing a few setups to get the GOOGLE_CLIENT_ID & GOOGLE_CLIENT_SECRET for getting permissions and once access is granted i would be able to modify,create folders,upload files & delete files/folders on my google drive
.
So my curiosities is, can i use other authentication libraries like clerk and lucia, to get a equivalent of GOOGLE_CLIENT_SECRET & GOOGLE_CLIENT_ID= in which can grant me access to my google account?
Hope my question makes sense to y'all
Why Postgres query is not using column in Index Condition but uses it in Filter condition
Programing Coderfunda
September 08, 2024
No comments
Query:
SELECT
relevant_incidents_per_inventory_item.inventory_id,
tracker_id
FROM
relevant_incidents_per_inventory_item
JOIN
incident_tracker_details
ON
incident_tracker_details.incident_id = relevant_incidents_per_inventory_item.incident_id
WHERE
incident_tracker_details.company_id = :companyId
and incident_tracker_details.division_id = :divisionId
AND incident_tracker_details.value > 0
the index in use:
create index companyid_divisionId_incidentId_idx
on incident_tracker_details (company_id, division_id, incident_id)
where (value > 0) include (tracker_id);
the relevant_incidents_per_inventory_item does not have any relevant indexes and the table is very small (few hundreds of rows).
the actual query plan:
QUERY PLAN
Hash Join (cost=6901.58..6913.72 rows=1 width=8) (actual time=90.663..315.278 rows=522 loops=1)
Hash Cond: (incident_tracker_details.incident_id = relevant_incidents_per_inventory_item.incident_id)
-> Index Only Scan using companyid_divisionId_incidentId_idx on incident_tracker_details (cost=0.57..12.68 rows=6 width=16) (actual time=0.039..202.787 rows=246774 loops=1)
Index Cond: ((company_id = '777704491747470679'::bigint) AND (division_id = '777795770460846005'::bigint))
Heap Fetches: 124039
-> Hash (cost=6900.88..6900.88 rows=10 width=8) (actual time=86.704..86.709 rows=259 loops=1)
...not relevant part
Planning Time: 0.518 ms
Execution Time: 315.402 ms
Why is the "incident_id" not part of the Index Cond? this leads to retrieving all the rows under companyId, divisionId , and then the engine has to filter all the rows for those having incident_tracker_details.incident_id = relevant_incidents_per_inventory_item.incident_id
I expected to see all the columns used in the Index Condition, leading to fast retrieval of only the relevant data
SQL Server options to handle a large table, from the options listed below [closed]
Programing Coderfunda
September 08, 2024
No comments
In order to scale the database, and for performance, I am considering the implementation partitioned tables, however, I keep reading about downsides. I wanted about your experiences and preferred approach between the options listed below, in the context of implementation ease, efficiency and subsequent maintenance:
* Partitioning table
* Indexed views
* Sharding
* Filtered indexes
* Partitioned views
* In-Memory OLTP
Sonatype Nexus OSS 3.69.0 Npm Issue
Programing Coderfunda
September 08, 2024
No comments
For Maven and Docker, it is working fine.
But when it comes to npm, when I use the Nexus container with these image on my local machine without internet access, everything works as expected., However, when I run the same setup in another environment(aws ec2 with 8CPU,32GB RAM), also without internet access, I encounter issues with npm.
Specifically, npm takes about five minutes to retrieve a single package. The npm repository is a combination of both proxy(2k dependencies) and hosted repositories(7 artifacts), and I have artifacts stored in both. Despite this, I am seeing significant delays.
To install a single package, it is taking around 4-5 minutes. instead, 1-2 seconds in local.
I have confirmed that npm ping works correctly, and I can download npm artifacts using wget with no problems. However, npm install is where the issue occurs.
Could you please help me understand why this is happening and how it can be resolved?
In logs also I cannot see any., regarding delays.,
Configuration details:
some packages are in hosted repo, and some are in proxy cached, I kept negative cache to 0, and turned off it, meatda age and max component ages to -1., to use the caching always…No routing rules, and no firewalls enabled etc.
and this is the data that I am using in to create proxy npm repo:
{
“name”: “‘$npm_proxy_repository_name’”,
“online”: true,
“storage”: {
“blobStoreName”: “default”,
“strictContentTypeValidation”: true
},
“cleanup”: {
“policyNames”: [
“string”
]
},
“proxy”: {
“remoteUrl”: “
https://registry.npmjs.org”,
/> “contentMaxAge”: -1,
“metadataMaxAge”: -1
},
“negativeCache”: {
“enabled”: false,
“timeToLive”: 0
},
“httpClient”: {
“blocked”: false,
“autoBlock”: false,
“connection”: {
“retries”: 10,
“userAgentSuffix”: null,
“timeout”: 120,
“enableCircularRedirects”: false,
“enableCookies”: false,
“useTrustStore”: false
},
“authentication”: null
},
“routingRule”: “string”,
“replication”: {
“preemptivePullEnabled”: false,
“assetPathRegex”: “string”
},
“npm”: {
“removeNonCataloged”: false,
“removeQuarantined”: false
}
}
It’s a mysterious question still for us , why it is working in local mcahine, not in the aws server,
FYI, using the nexus server and npm client server, both are in same machine
07 September, 2024
Shiny downloadButton Status: Waiting for print(obj, file) execution before updating status
Programing Coderfunda
September 07, 2024
No comments
I want to show the save status in the button by changing its label and icon.
I am using a downloadButton to allow the user to specify the location and file name. The report is an officer word document saved using print(obj, target).
The expected flow is:
* user clicks button
* button changes to "Saving..."
* file dialogue opens
* user selects file name/location
* r attempts to save the document
* if the save is successful (i.e., no errors)the button changes to "Saved"
* otherwise, button changes to "Save Failed"
The actual flow is:
* user clicks button
* button changes to "Saving..."
* file dialogue opens
* button changes to "Saved"
* user selects file name/location
* ...
The script does not wait for the user to select the file or see if the file saves correctly before changing the status to "Saved." In this case, the file is saving correctly, but the script has no way of knowing that before it prints to target, and it cannot print to target until the user provides the file name/location.
How may I revise this so that the status change is related to whether or not the file was saved without error?
library(shiny)
library(shinyjs)
library(officer)
ui
Are there any Laravel courses or reading materials where the author shares experiences that I can't find in the documentation?
Programing Coderfunda
September 07, 2024
No comments
I recently bought Laracasts. It's nice, but it felt like documentation for lazy people. I already knew most of the things they covered just by reading the documentation (e.g., Filament).
Are there any courses or reading materials where people mainly share their experiences instead of simply rephrasing the documentation? I don't have a specific goal—I'm just looking to spend my spare time learning more about Laravel.
I often come across blog posts, videos, etc., for other programming languages like Java or Python that talks about real world problems and how those people solve those problems with the tools frameworks or languages provide, and I want to find similar content for Laravel or PHP in general.
but most of the content i find is already in the documentation.
For example, I’ve never seen much content on massively scaling Laravel queues.
note: this post is not intended to bash laracasts or say its not good or bash authors who wrote tutorials/make videos about laravel etc. i am simply looking for something different. submitted by /u/desiderkino
[link] [comments]









