Skip to content

Instantly share code, notes, and snippets.

View najathi's full-sized avatar
💻
Developing

Najathi najathi

💻
Developing
View GitHub Profile
@najathi
najathi / bash.txt
Last active September 1, 2022 07:16
Batch process for file manager
Make Folder
for i in {11..30}; do mkdir S$i; done;
make file
for i in {1..30}; do cd "S$i"; unlink file.txt; cd ..; done;
bulk rename files in a folder
for filename in ./*.*; do mv "$filename" "./${filename%.*}.jpg"; done;
bulk rename files in a folder to sequential numbers
@najathi
najathi / web.php
Last active March 9, 2022 03:54
test with zgabievi/laravel-promocodes
$promo = new \Gabievi\Promocodes\Promocodes();
// return $promo->create($amount = 2, $reward = '25', $data = ['intent' => 'sign up promo'], $expires_in = 20, $quantity = 1, $is_disposable = false);
//return $promo->output();
//return $promo->createDisposable($amount = 5, $reward = '25', $data = ['intent' => 'sign up promo'], $expires_in = 20, $quantity = null);
//return $promo->check('NJJA-4YAQ');
//return $promo->redeem('NJJA-4YAQ');
//return $promo->apply('4PXY-RU2R');
//return $promo->all();
import React, { useCallback, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import { Editor } from "react-draft-wysiwyg";
import { convertToRaw, RichUtils } from "draft-js";
import { convertToHTML } from 'draft-convert';
import DOMPurify from 'dompurify';
import { toast } from 'react-toastify';
import draftToHtml from 'draftjs-to-html';
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
import React from "react";
import SunEditor from 'suneditor-react';
import {
align,
font,
fontColor,
fontSize,
formatBlock,
hiliteColor,
horizontalRule,
@najathi
najathi / aws-s3-download-backet
Last active April 18, 2022 17:15
Downloading an entire S3 bucket?
100% works for me, i have download all files from aws s3 backet.
install aws cli (and select your operating system , follow the steps):
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
check aws version:
aws --version
run config command:
aws configure
@najathi
najathi / steps
Last active June 1, 2022 05:25
Create Virtual Host very quickly in Windows OS..
1. Open run (Win + R) and enter this location => D:\xampp\apache\conf\extra
2. Open this file with Any Editor (VS Code recommeded) => httpd-vhosts.conf
3. Add this line and save the file
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/demo-app/demo-api/public"
ServerName demo-api.test
</VirtualHost>
4. Open run (Win + R) and enter this location => C:\Windows\System32\drivers\etc\hosts
@najathi
najathi / SecurePassword.cs
Created July 12, 2022 04:20
Encrypt and Decrypt the password in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
using System.IO;
namespace Your_Namespace
{
@najathi
najathi / StringToLongConverter.cs
Created August 3, 2022 08:57
C# JSON Serialize changes String to Number type
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
public class StringToLongConverter : JsonConverter
{
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JToken jt = JValue.ReadFrom(reader);
return jt.Value<string>();
@najathi
najathi / DateRangeFilter.js
Last active August 16, 2022 02:41
moment js date range filter using antd
import React from "react";
import { DatePicker, Button } from "antd";
import styles from "./DateRangeFilter.module.scss";
class DateRangeFilter extends React.PureComponent {
handleChange = (value) => {
if (!value) return;
@najathi
najathi / install.txt
Last active September 15, 2022 07:49
Redis Configuration
Follow this instractions
1. Install usig WSL (This step only for windows machine)
Windows Subsystem Linux: https://docs.microsoft.com/en-us/windows/wsl/install
2. check distribution
uname
3. install redis
sudo apt-get update