Skip to content

Instantly share code, notes, and snippets.

View sahilkashyap64's full-sized avatar
🎯
Focusing

Sahil Kashyap sahilkashyap64

🎯
Focusing
View GitHub Profile
@sahilkashyap64
sahilkashyap64 / script.turf-sandbox
Created January 23, 2023 14:21
turf-sandbox snippet
// simply return a valid GeoJSON and it will be rendered on the map
var REGION_CAR_DELIVERY = turf.polygon([[
[ -118.2472203, 34.0805791 ],
[ -118.2458824, 34.0831055 ],
[ -118.2441979, 34.0848758 ],
[ -118.241408, 34.0872652 ],
[ -118.2399476, 34.0900534 ],
[ -118.2407174, 34.0913652 ],
[ -118.2430294, 34.0937757 ],
[ -118.2455076, 34.0964647 ],
@sahilkashyap64
sahilkashyap64 / script.turf-sandbox
Created January 23, 2023 14:21
turf-sandbox snippet
var REGION_CAR_DELIVERY = turf.polygon([[
[ -118.2472203, 34.0805791 ],
[ -118.2458824, 34.0831055 ],
[ -118.2441979, 34.0848758 ],
[ -118.241408, 34.0872652 ],
[ -118.2399476, 34.0900534 ],
[ -118.2407174, 34.0913652 ],
[ -118.2430294, 34.0937757 ],
[ -118.2455076, 34.0964647 ],
[ -118.2473742, 34.098147 ],
@sahilkashyap64
sahilkashyap64 / LoginPage.jsx
Last active May 19, 2022 12:49
Social login(Google,FB) Backend
//react frontend
import { GoogleLogin } from 'react-google-login';
import FacebookLogin from 'react-facebook-login';
class LoginPage extends Component {
constructor(props) {
super(props);
this.state = {
userId: '',
password: '',
@sahilkashyap64
sahilkashyap64 / readme.md
Last active January 28, 2022 10:15
Stripe webhook laravel

Stripe's platform includes webhooks that will notify you when actions take place on your account. You can be notified when things changes in your Stripe dashboard.

In your Stripe Dashboard, go to the Developer section, then click on the Webhooks tab.

You should add a receiving endpoint by clicking Add Endpoint*. Fill in the public URL provided by ngrok, or any other public URL that can reach the webhook monitor.

** make sure to add http:yourwebsite.com/stripe/webhook **

enterurlendpointinstripe

@sahilkashyap64
sahilkashyap64 / SubscriptionController.php
Created January 26, 2022 12:39
Stripe Subscription cursor pagination: scroll and append page number and also search via customer or plan
<?php
//app/Http/Controllers/Admin/SubscriptionController.php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
/**
@sahilkashyap64
sahilkashyap64 / DropzoneController.php
Last active July 4, 2023 14:19
Multi upload image with name using dropzone drag and drop name field in laravel
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class DropzoneController extends Controller
{
function index()
{
@sahilkashyap64
sahilkashyap64 / QRLoginTwoController.php
Last active October 21, 2021 21:27
Ratchet websocket qr login like whatsapp laravel ,cboden/ratchet
<?php
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class QRLoginTwoController extends Controller
{
public function qrtesting()
{
@sahilkashyap64
sahilkashyap64 / QRLoginTwoController.php
Last active December 23, 2022 15:00
Laravel QR login using polling like whatsapp with memecache
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Cache;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
use Memcache;
use Illuminate\Support\Facades\Auth;
@sahilkashyap64
sahilkashyap64 / window-controller.js
Created July 10, 2021 06:10 — forked from neilj/window-controller.js
Cross-tab window controller
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );