You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
😜
Focusing
Dhanu K
bewithdhanu
😜
Focusing
An enthusiastic software engineer with a passion for developing and designing innovative software solutions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Laravel - Prevent SQL Injection attacks with global change
Laravel - Prevent SQL Injection Attacks - Global Change
Create a Middle called PreventSQLInjection.php
This code basically takes in a request and add escape quotes to the input data, thus data passing to controllers will be filtered and incase of base64 encoded data coming as input we are avoiding that to be filtered
Registering your Middleware
When registering your middleware you have 3 choices.
S3 File upload Kotlin using Amazon STS temporary credentials
privatefundoFileTransfer(file:File) {
val mCredentials =BasicSessionCredentials(YOUR_ACCESS_KEY, YOUR_SECRET_KEY, YOUR_SECRET_TOKEN)
val s3:AmazonS3=AmazonS3Client(mCredentials)
s3.setRegion(Region.getRegion(Regions.US_EAST_2))
mTransferUtility =TransferUtility.builder().s3Client(s3).context(mApplication).build()
val objectKey ="android/${file.nameWithoutExtension}.${file.extension}";
val access =CannedAccessControlList.Private
Android check for bluetooth devices using alarm manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cron jobs are a powerful tool for automating routine tasks in your web application. However, if you're running your application with Apache, it's important to ensure that your cron jobs are running under the correct user to avoid issues with file permissions.
By default, the crontab command works on a user level, meaning that any jobs created using crontab -e will be executed under the user that created them (e.g., ubuntu or root). If you're running a web application with Apache, it's likely that the user that Apache runs under is www-data. This means that if you create a cron job under ubuntu or root, the files created by that job may not have the correct permissions for Apache to access them, resulting in errors like "Permission denied".
To avoid this issue, it's best to create a cron job under the www-data user using the command sudo crontab -u www-data -e. This ensures that the job is executed under the correct user, and any files create
Telescope is a powerful debugging tool for Laravel applications. It provides a beautiful interface for debugging and monitoring your application in real-time. With Telescope, you can easily find performance bottlenecks, track down errors, and debug your code more efficiently.
Optimising Your Web Content for Social Media: A Guide to Using Meta Tags
Here are the meta tags you can use for various social media platforms:
Facebook
<metaproperty="og:url" content="https://example.com"><metaproperty="og:type" content="website"><metaproperty="og:title" content="My Page"><metaproperty="og:description" content="This is a description of my page.">