Skip to content

Instantly share code, notes, and snippets.

View bhaveshdaswani93's full-sized avatar
๐Ÿ‘‹
Building Awesome things with Laravel React Vue

Bhavesh Daswani bhaveshdaswani93

๐Ÿ‘‹
Building Awesome things with Laravel React Vue
View GitHub Profile
@bhaveshdaswani93
bhaveshdaswani93 / gist:bd08d5fbbeea0b8dbfb2669af0d9e455
Last active May 27, 2025 02:46
Prompts for asking to use existing library or language built-in function
Example
I want to split the cookies in javascript, can you write an function for that?
updated prompt for using built in javascript method or existing library, then try for custom logic function
I want to split the cookies in javascript, can you use built in method or use existing library or write an function for that?
Priority if built method in javascript language is there use that
Then try for existing library
@bhaveshdaswani93
bhaveshdaswani93 / gist:40953de22c3b046172cd1615cd4ae62f
Created May 26, 2025 08:20
inline edit demo for Laravel request validation
Add laravel request validation for description key to be required and title should be required and max length to be 200 characters
@bhaveshdaswani93
bhaveshdaswani93 / gist:386917f89a80d30ef1d4542bdabf6010
Created May 24, 2025 08:29
add description text field to posts table
prompt: Add description field with text data type, also add name field with string datatype for name max width is 200 characters
let use useFetchData to the api https://jsonplaceholder.typicode.com/posts
it has response live
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
@bhaveshdaswani93
bhaveshdaswani93 / 02-milestone-project-1-walkthrough-steps-workbook.ipynb
Created June 27, 2024 02:16
02-Milestone Project 1 - Walkthrough Steps Workbook.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@bhaveshdaswani93
bhaveshdaswani93 / .htaccess
Created December 21, 2020 05:42
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@bhaveshdaswani93
bhaveshdaswani93 / class_decorator.ts
Created February 4, 2020 03:39 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@bhaveshdaswani93
bhaveshdaswani93 / composition_vs_inheritance.js
Created January 4, 2020 08:54
composition vs inheritance explained by example
// we have to represent human relation in oop style
class Human {
constructor(firstName,lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
sleepNow() {
console.log(`${this.firstName} ${this.lastName} is sleeping`)
}
@bhaveshdaswani93
bhaveshdaswani93 / arity_in_javascript.js
Created December 29, 2019 13:30
Arity in javascript
const addNumber = (num1,num2) => num1+num2
const getAbsoulte = (num) => Math.abs(num)
// addNumber has arity of two
// getAbsoulte has arity of one