Skip to content

Instantly share code, notes, and snippets.

View CodeBySwati's full-sized avatar
🏠
Working from home

Swati Srivastava CodeBySwati

🏠
Working from home
  • Freelancer
  • Copenhagen
View GitHub Profile
@CodeBySwati
CodeBySwati / piglatin.md
Last active December 19, 2024 16:06
Create a script in php that translates the input into PigLatin. 1. If a word starts with a consonant, put the first letter of the word at the end of the word and add "ay." ex: happy = appyh + ay = appyhay

PHP script that translates the input into PigLatin.

1. If a word starts with a consonant, put the first letter of the word at the end of the word and add "ay."

ex: happy = appyh + ay = appyhay

Here's a PHP script that translates input text into Pig Latin:

<?php
function toPigLatin($input) {
    // Split the input into words
    $words = explode(' ', $input);
@CodeBySwati
CodeBySwati / GistCommentController.php
Created January 11, 2024 17:19
Create a Laravel application to manage code snippets, based on GitHub Gist's.
// Controller/GistCommentController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Config;
class GistCommentController extends Controller
@CodeBySwati
CodeBySwati / update_gist.pl
Created January 11, 2024 12:13
Gist update script
#!/usr/bin/perl5.12.4
use JSON;
use LWP::Simple;
use Cwd;
my $data = get "http://gist.github.com/api/v1/json/gists/damianzaremba";
my $json = decode_json($data);
my $gists = $json->{"gists"};
for my $gist (@$gists) {
@CodeBySwati
CodeBySwati / file.txt
Last active January 11, 2024 14:20
Test Gist 4.0
Updated content here...
@CodeBySwati
CodeBySwati / readme.text
Created January 10, 2024 15:30
Test Gist 2
This is a testing gist
@CodeBySwati
CodeBySwati / php_formatting_vscode.md
Last active January 11, 2024 13:57
PHP and HTML Formatting in VS Code
@CodeBySwati
CodeBySwati / cancel.php
Last active December 2, 2024 17:53
PayPal Payment Integration in PHP
<h1>Sorry! Your PayPal Payment has been cancelled.</h1>
@CodeBySwati
CodeBySwati / index.php
Created January 8, 2024 13:33
Upload Image in Folder using PHP [Without Database]
<?php
//Upload Image
if (isset($_POST["cover_up"])) {
$imgFile = $_FILES["coverimg"]["name"];
$tmp_dir = $_FILES["coverimg"]["tmp_name"];
$imgSize = $_FILES["coverimg"]["size"];
if (!empty($imgFile)) {
$upload_dir = "image/"; // upload directory