Skip to content

Instantly share code, notes, and snippets.

View pradeeprjth's full-sized avatar
🎯
Focusing

Pradeep pradeeprjth

🎯
Focusing
  • Cotocus.com
View GitHub Profile
@pradeeprjth
pradeeprjth / CRUD_fileSystem_with_node.js
Created February 18, 2022 13:13
Performing CRUD operation inside a folder named CRUD , Creating ,reading,updating,renaming,deleting using file system core module NodeJs
const fs = require('fs');
const path = require('path');
const dirPath = path.join(__dirname,'crud');
const filePath = `${dirPath}/fruit.txt`;
// Create File Using File System
// fs.writeFileSync(filePath,'This is a simple text file');
$('#text').keyup(function () {
var currVal = $(this).val();
$(this).val(currVal.charAt(0).toUpperCase() + currVal.slice(1).toLowerCase());
});
<?php
namespace App\Http\Controllers;
class WebPageSizeCheckerController extends Controller
{
public function post(Request $request)
{
$url = $request->url;
@pradeeprjth
pradeeprjth / php_Switch_Statement.js
Created February 9, 2022 08:59
the const persion is a array of fullname
const person = {
fullName: function() {
return this.firstName + " " + this.lastName;
}
}
const person1 = {
firstName: "Mary",
lastName: "Doe"
}
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$('#imageResult')
.attr('src', e.target.result);
};
reader.readAsDataURL(input.files[0]);
}
}
alert( Math.max(3, 5, 1) ); // 5
let arr = [3, 5, 1];
alert( Math.max(arr) );
let arr = [3, 5, 1];
alert( Math.max(...arr) ); // 5 (spread turns array into a list of arguments)
// --------------------------------------------
function sum(...theArgs) {
return theArgs.reduce((previous, current) => {
return previous + current;
});
}
console.log(sum(1, 2, 3));
// expected output: 6
console.log(sum(1, 2, 3, 4));
console.clear()
var mList = [1, 2, 3, 4, 5]
// var pos;
// for(pos = 0; pos < mList.length; pos++) {
// console.log('Position => ' + pos + ' Value => ' + mList[pos])
// }
// Break Keyword
console.clear()
var mFriends = ['Shaw', 'Clara', 'Vab', 'Kun', 'Jacob', 'Dina']
console.log(mFriends)
console.log(typeof(mFriends))
console.log(mFriends[2])
console.log(mFriends[0])
console.log(mFriends[4])
console.clear()
// var mCars = {
// "p1" : "350 kmph",
// "gallardo" : '320 kmph',
// "veyron" : '409 kmph',
// "agera" : '429 kmph'
// }
// console.log(mCars)