Skip to content

Instantly share code, notes, and snippets.

View Neeraj1005's full-sized avatar
🎯
Focusing

Neeraj Singh Neeraj1005

🎯
Focusing
View GitHub Profile
@Neeraj1005
Neeraj1005 / HomeScreen.tsx
Created May 16, 2024 07:23
React Native Lottie Animation
import LottieView from "lottie-react-native";
import { Fragment, useRef, useState } from "react";
import { Button, Dimensions, StyleSheet, Text, View } from "react-native";
export default function HomeScreen() {
const [playPause, setPlayPause] = useState<string>("play");
const animationRef = useRef<LottieView>(null);
const runAnimation = (mode: string) => {
if (mode === "play") {
@Neeraj1005
Neeraj1005 / docker-cmd.md
Created January 8, 2024 11:46
Docker commands

Docker Commands

  • Run Docker Image: docker run -it your-image-name
  • Or, if you want to run a specific command within the image, like running a bash shell: docker run -it your-image-name /bin/bash
  • Create Docker Image: docker build -t your-project-name . The dot at the end indicates that the build should occur in the root directory. If you want to build from a different directory, use the ../ syntax.
  • List Docker Images: docker images
  • Remove Docker Image: docker image rm image-name
  • Forcefully Remove Docker Image: docker image rm image-name -f
  • List Containers: docker ps -a
  • Remove Container: docker container rm container_name
@Neeraj1005
Neeraj1005 / Generating-a-Debug-APK-File-in-React-Native.md
Created May 19, 2023 04:37
Generating a Debug APK File in React Native

Generating a Debug APK File in React Native

Introduction

This documentation provides step-by-step instructions on how to generate a debug APK (Android Package) file for a React Native application. The debug APK is primarily used for testing and debugging purposes during the development phase.

Prerequisites

Before proceeding, ensure that you have the following prerequisites in place:

@Neeraj1005
Neeraj1005 / slider-next-prev.md
Created February 15, 2023 09:24 — forked from neeraj-tangariya/slider-next-prev.md
slider next and previous button incrementation and decrementation
let up = true;
let down = true;
let screenCounter = 0;
let incrementBy = 1;
let defaultTftMode = "light";
const lengthOfScreen = 4;

// direction would be up or down
function changeScreen(direction = null) {
@Neeraj1005
Neeraj1005 / spatie_query_builder_example.md
Created July 16, 2022 03:55
spatie query builder uses for calling scope and includes

Controller

$tickets = QueryBuilder::for(Ticket::class)
            ->allowedFilters(['ticket_number', 
                                'name', 
                                'status_id', 
                                'type_id', 
                                'priority_id', 
                                'user_id', 
                                AllowedFilter::partial('ticketStatus.name'),
@Neeraj1005
Neeraj1005 / laravel-delete-using-anchor-tag.md
Created July 14, 2022 08:07
add delete functionality in same page

#in blade file to perform delete using anchor tag with js

<x-layouts.app>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <div class="row">
                        <div class="col-md-5">
                            Employees
@Neeraj1005
Neeraj1005 / fullcalendar5-with-pop-up.md
Last active October 5, 2021 13:09
fullcalendar5 with custom pop up
<style>
    .tooltipevent {
        width: 400px;
        background: #ccc;
        position: absolute;
        z-index: 10001;
        transform: translate3d(-50%, -100%, 0);
        font-size: 0.8rem;
        box-shadow: 1px 1px 3px 0px #888888;
@Neeraj1005
Neeraj1005 / laravel-localization-setup.md
Last active August 11, 2021 12:29
Adding localization in laravel app. (Multiple language support)

How you can setup multilanguage in your laravel app

Step1:

  • first, add a languages array in config/app.php
 'languages' => [
      'en' => 'English',
      'hi' => 'Hindi',
  ],
@Neeraj1005
Neeraj1005 / add-ckeditor-in-laravel-livewire.md
Last active July 30, 2024 14:23
Add CKEDITOR in Laravel-Livewire

textarea tag field

<div wire:ignore class="form-group row">
    <x-label class="col-md-3 col-form-label" for="message" :value="__('Compose message')" />
    <div class="col-md-9">
        <textarea wire:model="message" class="form-control required" name="message"
            id="message"></textarea>
        <x-error-message :value="__('message')" />
    </div>
</div>
@Neeraj1005
Neeraj1005 / High-order-component.js
Last active February 1, 2023 22:46
it is work as route middleware if user is not logged then go back to login page.
import { Component } from "react";
import cookies from "next-cookies";
import { TOKEN_STORAGE_KEY, USER_STORAGE_KEY } from "@/services/auth.service";
export function ProtectedRoute(WrapperComponent) {
return class extends Component {
static async getInitialProps(ctx) {
const token = cookies(ctx)[TOKEN_STORAGE_KEY];
if (!token) {
// const route = '/login?dest=' + ctx.asPath;