Skip to content

Instantly share code, notes, and snippets.

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
class MainContoller extends Controller
{
public function login(Request $request)
@salmanx
salmanx / calender_overlapp.rb
Last active June 3, 2024 09:47
Ruby program to check overlapping calendar
class Calender
attr_accessor :start_time, :end_time
def initialize(start_time:, end_time:)
@start_time = start_time
@end_time = end_time
end
end
def is_overlapping?(c1, c2)
@salmanx
salmanx / airwork.js
Last active May 21, 2025 06:56
air work coding test
// Problem 1: Move Zeroes
function moveZeroToEnd(arr) {
const count = {};
const result = [];
arr.forEach((element) => {
count[element] = (count[element] || 0) + 1;
});
@salmanx
salmanx / reformatPolicyNumbers.js
Created January 5, 2025 05:31
Format a number in a paragraph
function reformatPolicyNumbers(paragraph) {
const policyNumbers = paragraph.split(" ");
policyNumbers.map((word, index) => {
const policyNumber = word.split("-");
if (policyNumber.length === 3 && !isNaN(Number(policyNumber.join("")))) {
policyNumbers[index] = policyNumber.join("/");
}
});