Snippets Collections
var jwt = require('jsonwebtoken');
const userModel = require('../model/user');

function Auth (req, res, next) {

    const getUserCookies = req.cookies.userData;

    if(!getUserCookies){
        res.status(200).json({message: 'Login First'})
    }

    jwt.verify(getUserCookies.token, 'shhhhh', async function(err, decoded) {
        req.user = await userModel.findById(decoded._id);
        if (!req.user) {
            return res.status(401).json({ error: 'Invalid token. User not found.' });
          }
        next() // bar
    });
}

module.exports = Auth;


const mongoose = require('mongoose');

const userSchema = new mongoose.Schema({
   
    email:{
        type: 'string',
        required: true
    },
    password:{
        type: 'string',
        required: true
    }

  });

  const userModel = mongoose.model('User', userSchema);

  module.exports = userModel;


var express = require('express');
var router = express.Router();
const userModel = require('../model/user');
var jwt = require('jsonwebtoken');
const Auth = require('../middleware/Auth');

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

const createUser = async (req,res,nexr) => {

  try {
    
    const userDatasave = new userModel({
      email: req.body.email,
      password: req.body.password
    })

    const saveUser = await userDatasave.save();

    res.status(200).json({
      status: 'success',
      saveUser: saveUser
    })

  } catch (error) {

    console.log(error.message);

    res.status(500).json({
      status: 'Server Error',
    })
    
  }

}

const checkUser = async (req,res,nexr) => {

  try {
    
    const {email, password} = req.body;
    const findUser = await userModel.findOne({email})

    if(findUser){

      if(findUser.password === password){

        var token = jwt.sign({ _id: findUser._id }, 'shhhhh', { expiresIn: '1h'});
        res.cookie('userData',{...findUser,token},{httpOnly: true});
        res.status(200).json({
          status: 'login successful',
          token
        })

      }else{

        res.status(200).json({
          status: 'Wrong Password',
        })

      }

    }else{

      res.status(200).json({
        status: 'User not Found',
      })

    }

  } catch (error) {

    console.log(error.message);

    res.status(500).json({
      status: 'Server Error',
    })
    
  }

}

const getAllUser = async (req,res,nexr) => {

  try {
    const findUser = await userModel.find({})

    res.status(200).json({
      status: 'success',
      findUser: findUser
    })

  } catch (error) {

    console.log(error.message);

    res.status(500).json({
      status: 'Server Error',
    })
    
  }

}

const userLogout = async (req,res,nexr) => {

  try {
    res.clearCookie('userData');

    res.status(200).json({
      status: 'user logged out successfully',
    })

  } catch (error) {

    console.log(error.message);

    res.status(500).json({
      status: 'Server Error',
    })
    
  }

}


router.post('/saveuser',createUser);
router.post('/loginuser',checkUser);
router.get('/getuser',Auth,getAllUser);
router.get('/logout',Auth,userLogout);


module.exports = router;


//Models
//Reward
public class Reward
{
    [Key]

    public int Reward_ID { get; set; }

    [Required]
    public string Prize { get; set; }

    [Required]
    public DateTime Reward_Issue_Date { get; set; }

    public int Member_ID { get; set; }

    [ForeignKey(nameof(Member_ID))]
    public Member Member { get; set; }

    
    public int Reward_Type_ID { get; set; }


    [ForeignKey(nameof(Reward_Type_ID))]
    public Reward_Type Reward_Type { get; set; }


    public bool IsRedeemed { get; set; } // New property to track redemption status
}

//RewardType
public class Reward_Type
{
    [Key]
    public int Reward_Type_ID { get; set; }

    [Required]
    public string Reward_Type_Name { get; set; }

    [Required]
    public string Reward_Criteria { get; set; }
}

//Reward_Member
public class Reward_Member
{
    [Key]
    public int Reward_Member_ID { get; set; }

    public int Number_Of_Qualified_Members { get; set; }

    public int Member_ID { get; set; }

    [ForeignKey(nameof(Member_ID))]

    public Member Member { get; set; }


    public int Reward_ID { get; set; }

    [ForeignKey(nameof(Reward_ID))]

    public Reward Reward { get; set; }
}

//ViewModels
//RewardViewModel
public class RewardViewModel
{
    public int MemberId { get; set; }
    public int RewardId { get; set; }
}

//AppDbContext
//Reward Seed Data
var Rewards = new Reward[]
{
    new Reward { Reward_ID = 1, Prize = "Free Gym Membership", Reward_Issue_Date = new DateTime(2024, 4, 10), Member_ID = 1, Reward_Type_ID = 1 }

};
builder.Entity<Reward>().HasData(Rewards);


//Reward_Member Seed Data
var Reward_Members = new Reward_Member[]
{
    new Reward_Member{ Reward_Member_ID = 1,Number_Of_Qualified_Members = 3,Member_ID = 1, Reward_ID = 1}
};
builder.Entity<Reward_Member>().HasData(Reward_Members);

//Controller
[Route("api/[controller]")]
[ApiController]
public class RewardController : ControllerBase
{
    private readonly AppDbContext _appDbContext;

    public RewardController(AppDbContext appDbContext)
    {
        _appDbContext = appDbContext;
    }

    [HttpPost]
    [Route("createRewardType")]
    public async Task<IActionResult> CreateRewardType(RewardTypeViewModel rt)
    {
        try
        {
            var rewardType = new Reward_Type
            {
                Reward_Type_Name = rt.Reward_Type_Name,
                Reward_Criteria = rt.Reward_Criteria
                
            };
            _appDbContext.Reward_Types.Add(rewardType);
            await _appDbContext.SaveChangesAsync();

            return CreatedAtAction(nameof(GetRewardTypeById), new { id = rewardType.Reward_Type_ID }, rewardType);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getAllRewardTypes")]
    public async Task<IActionResult> GetAllRewardTypes()
    {
        try
        {
            var rewardTypes = await _appDbContext.Reward_Types.ToListAsync();
            return Ok(rewardTypes);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getRewardTypeById/{id}")]
    public async Task<IActionResult> GetRewardTypeById(int id)
    {
        try
        {
            var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

            if (rewardType == null)
            {
                return NotFound();
            }

            return Ok(rewardType);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpPut]
    [Route("updateRewardType/{id}")]
    public async Task<IActionResult> UpdateRewardType(int id, [FromBody] RewardTypeViewModel rt)
    {
        try
        {
            var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

            if(rewardType == null)
            {
                return NotFound();
            }

            //rewardType = new Reward_Type
            //{
            //    Reward_Type_Name = rt.Reward_Type_Name,
            //    Reward_Criteria = rt.Reward_Criteria
            //};

            rewardType.Reward_Type_Name = rt.Reward_Type_Name;
            rewardType.Reward_Criteria = rt.Reward_Criteria;

            _appDbContext.Entry(rewardType).State = EntityState.Modified;
            await _appDbContext.SaveChangesAsync();

            return NoContent();
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpDelete]
    [Route("deleteRewardType/{id}")]
    public async Task<IActionResult> DeleteRewardType(int id)
    {
        try
        {
            var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

            if(rewardType == null)
            {
                return NotFound();
            }

            _appDbContext.Reward_Types.Remove(rewardType);
            await _appDbContext.SaveChangesAsync();

            return NoContent();
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }



    [HttpPost]
    [Route("redeemReward")]
    public async Task<IActionResult> RedeemReward([FromBody] RewardViewModel request)
    {
        try
        {
            // Fetch the reward by ID
            var reward = await _appDbContext.Rewards
                                            .FirstOrDefaultAsync(r => r.Reward_ID == request.RewardId && r.Member_ID == request.MemberId);

            if (reward == null)
            {
                return NotFound("Reward not found or not eligible for the member.");
            }

            // Check if the reward is already redeemed
            if (reward.IsRedeemed)
            {
                return BadRequest("Reward is already redeemed.");
            }

            // Mark the reward as redeemed
            reward.IsRedeemed = true;
            _appDbContext.Entry(reward).State = EntityState.Modified;
            await _appDbContext.SaveChangesAsync();

            return Ok(new { Status = "Success", Message = "Reward redeemed successfully!" });
        }
        catch (Exception)
        {
            return BadRequest("An error occurred while redeeming the reward.");
        }
    }

    [HttpPost]
    [Route("setReward")]
    public async Task<IActionResult> SetReward(Reward r)
    {
        try
        {
            var reward = new Reward
            {
                Prize = r.Prize,
                Reward_Issue_Date = r.Reward_Issue_Date,
                Member_ID = r.Member_ID,
                Reward_Type_ID = r.Reward_Type_ID
            };
            _appDbContext.Rewards.Add(reward);
            await _appDbContext.SaveChangesAsync();

            return CreatedAtAction(nameof(GetRewardById), new { id = reward.Reward_ID }, reward);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getRewardById/{id}")]
    public async Task<IActionResult> GetRewardById(int id)
    {
        try
        {
            var reward = await _appDbContext.Reward_Types.FindAsync(id);

            if (reward == null)
            {
                return NotFound();
            }

            return Ok(reward);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getAllRewards")]
    public async Task<IActionResult> GetAllRewards()
    {
        try
        {
            var rewards = await _appDbContext.Rewards.ToListAsync();
            return Ok(rewards);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }
}
--> Collection(model)-->user.js --> userDetails.js
const mongoose = require('mongoose');

function validateEmail(email) {
    const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
    return emailRegex.test(email);
  }

const userModel = new mongoose.Schema({
    email:{
        type:String,
        require: true,
        unique: true,
        validate: {
            validator: validateEmail,
            message: 'Invalid email format',
        },
    },
    password:{
        type:String,
        require: true
    },
},
{
    timestamps: true
}
);

const userDataModel = mongoose.model('user', userModel);

module.exports = userDataModel;


const mongoose = require('mongoose');

const DetailModel = new mongoose.Schema({

    user_id:{
        type: mongoose.Schema.Types.ObjectId,
        ref:'user',
        required: true,
    },
    name:{
        type:String,
        require: true,
        validate: {
            validator: function(value) {
              const regex = /^[a-zA-Z]+$/;
              return regex.test(value);
            },
            message: 'Invalid characters in the name field. Only alphabets are allowed.'
          }
    },
    phone:{
        type:Number,
        require: true
    },
    country:{
        type:String,
        enum: ['USA', 'Canada', 'UK', 'Australia', 'India', 'Other'],
        require: true
    },
    additional_info:{
        type:String,
        require: true,
        validate: {
            validator: function(value) {
              const regex = /^[a-zA-Z0-9.,@_]+$/;
              return regex.test(value);
            },
            message: 'Invalid characters in additional_info field.'
          }
    },
    file:{
        type:String,
        required: true
    }
},
{
    timestamps: true
}
);

const userDetailModel = mongoose.model('userDetail', DetailModel);

module.exports = userDetailModel;





-->router --> user.js

var express = require('express');
var router = express.Router();
const multer = require('multer');
const fs = require('fs')
const path = require('path');
const userDataModel = require('../collection/user')
const userDetailModel = require('../collection/userDetail')

const storage = multer.diskStorage({
  destination: (req, file, cb) => {
    cb(null, 'uploads/');
  },
  filename: (req, file, cb) => {
    cb(null, `${Date.now()}_${file.originalname}`); 
  },
});

const fileFilter = (req, file, cb) => {
  const allowedMimes = ['application/pdf'];
  if (allowedMimes.includes(file.mimetype)) {
    cb(null, true);
  } else {
    cb(new Error('Invalid file type. Only PDF files are allowed.'));
  }
};

const upload = multer({
  storage: storage,
  limits: {
    fileSize: 50 * 1024 * 1024,
  },
  fileFilter: fileFilter,
});


const userRegister = async (req, res,next) => {

  try {

    const registerUser = new userDataModel({
      email: req.body.email,
      password: req.body.password,
    })

    const saveUser = await registerUser.save();

    const userid = saveUser._id;

    const userDetail = new userDetailModel({
      user_id: userid,
      name: req.body.name,
      phone: req.body.phone,
      country: req.body.country,
      additional_info: req.body.additional_info,
      file: req.file.filename,
    })

    const saveUserDetail = await userDetail.save();

    res.status(200).json({
      status:"Success",
      saveUser,
      saveUserDetail,
    })

    
  } catch (error) {
    fs.unlinkSync(req.file.path);
    if (error.name === 'ValidationError') {
      fs.unlinkSync(req.file.path);
      const validationErrors = {};
      for (const key in error.errors) {
        validationErrors[key] = error.errors[key].message;
      }
      return res.status(400).json({ errors: validationErrors });
    }
    console.error(error);
    res.status(500).send('Internal Server Error'); 
  }

}

const userList = async (req, res,next) => {

  try {

      const query = {};
      if (req.query.email) {
        query.email = { $regex: new RegExp(req.query.email, 'i') };
      }
      if (req.query.name) {
        query.name = { $regex: new RegExp(req.query.name, 'i') };
      }
      if (req.query.phone) {
        query.phone = req.query.phone;
      }
      if (req.query.country) {
        query.country = { $regex: new RegExp(req.query.country, 'i') };
      }

        const page = parseInt(req.query.page) || 1;
        const pageSize = parseInt(req.query.pageSize) || 5;

        
        const userDetails = await userDetailModel.aggregate([
          {
            $match: query,
          },
          {
            $lookup: {
              from: 'users',
              localField: 'user_id',
              foreignField: '_id',
              as: 'user',
            },
          },
          // {
          //   $unwind: '$user',
          // },
          {
            $skip: (page - 1) * pageSize,
          },
          {
            $limit: pageSize,
          },
        ]);

        res.json(userDetails);
      
  } catch (error) {
      res.status(500).send('Internal Server Error');
  }

}

const updateUser = async (req, res, next) => {
  try {
    const userId = req.params.id;

    const existingUserDetail = await userDetailModel.findOne({ user_id: userId });

    if (existingUserDetail && existingUserDetail.file) {
      const filePath = path.join('uploads/', existingUserDetail.file);
      fs.unlinkSync(filePath);
    }

    const updateUserData = await userDataModel.findByIdAndUpdate(
      userId,
      {
        email: req.body.email,
        password: req.body.password,
      },
      { new: true }
    );

    if(updateUserData === null){
      res.status(200).json({
        status: 'User Not Found',
      });
    }

    const updateUserDetail = await userDetailModel.findOneAndUpdate(
      { user_id: userId },
      {
        name: req.body.name,
        phone: req.body.phone,
        country: req.body.country,
        additional_info: req.body.additional_info,
        file: req.file.filename,
      },
      { new: true }
    );

    res.status(200).json({
      status: 'Success',
      updateUserData,
      updateUserDetail,
    });
  } catch (error) {
    fs.unlinkSync(req.file.path);
    if (error.name === 'ValidationError') {
      fs.unlinkSync(req.file.path);
      const validationErrors = {};
      for (const key in error.errors) {
        validationErrors[key] = error.errors[key].message;
      }
      return res.status(400).json({ errors: validationErrors });
    }
    console.error(error);
    res.status(500).send('Internal Server Error');
  }
};

const deleteUser = async (req, res, next) => {
  try {

    const userId = req.params.id;

    const deleteUser = await userDataModel.findByIdAndDelete(userId);

    if (!deleteUser) {
      return res.status(404).json({ status: 'Error', message: 'User not found' });
    }

    const deleteUserDetail =   userDetailModel.findOneAndDelete({ user_id: userId });

    if (deleteUserDetail.file) {
      const filePath = path.join('uploads/', deleteUserDetail.file);
      fs.unlinkSync(filePath);
    }

    res.status(200).json({
      status: 'Success',
      message: 'User deleted successfully',
    });
    
  } catch (error) {
    if (error.name === 'ValidationError') {
      const validationErrors = {};
      for (const key in error.errors) {
        validationErrors[key] = error.errors[key].message;
      }
      return res.status(400).json({ errors: validationErrors });
    }
    console.error(error);
    res.status(500).send('Internal Server Error');
  }
};

router.post("/addUser",upload.single('file'), userRegister);
router.get("/userList", userList);
router.put('/updateUser/:id', upload.single('file'), updateUser);
router.delete('/deleteUser/:id', deleteUser);


module.exports = router;


//middleware --> auth
const jwt = require('jsonwebtoken');

function Auth (req, res, next) {

    const token = req.session.token || req.cookies.token;

    if (!token) {
        return res.status(401).send({ error: 'Unauthorized' });
    }

    try {

        const payload = jwt.verify(token, "JWT_SECRET");
        req.user = payload;
        next();
        
    } catch (error) {
        res.status(401).send({ error: 'Unauthorized' });
    }

}

module.exports = Auth;



--> model --> user.js
const mongoose = require('mongoose');
const bcrypt = require('bcrypt');

const userSchema = new mongoose.Schema({
    username: 
    {
        type: 'String'
    },
    password:{
        type: 'String'
    }
  });

  userSchema.pre('save',async function (next){

    if(this.isModified('password')){
        this.password = await bcrypt.hash(this.password, 10);
    }
    next();
  })

  const userModel = mongoose.model('User', userSchema);

  module.exports = userModel;
  
  
  
  -->router --> user.js
  var express = require('express');
var router = express.Router();
var userModel = require('../model/user');
const auth = require('../middleware/auth');
const jwt = require('jsonwebtoken');
const bcrypt = require('bcrypt');
/* GET users listing. */

const CreateUser =  async (req,res,next) => {

    try {

       const createUser = new userModel({
        username: req.body.username,
        password: req.body.password
       })

       const saveData = await createUser.save();

       res.status(200).json({
        status: 'success',
        saveData
       })

      
    } catch (error) {

      res.status(500).json({
        status: 'error',
        error
      })
      
    }

}

const CheckUser = async (req,res,next) => {

  try {

    const {username , password } = req.body

    const findUser = await userModel.findOne({ username : username})

    if(findUser){

      bcrypt.compare(password, findUser.password, function(err, result) {
        // result == true
        if (result == true) {

          console.log(findUser);

          const token = jwt.sign({ _id: findUser._id }, "JWT_SECRET", { expiresIn: '1h' });
      
          res.cookie('token', token, { httpOnly: true });
          req.session.user = findUser;
      
          res.status(200).json({
            status: 'Login success',
            token
           })
          
        }else {

          res.status(500).json({
            status: 'Password Incorrect',
          })

        }
      });

    }else{

      res.status(500).json({
        status: 'User not Found',
      })

    }
    
  } catch (error) {
    
    res.status(500).json({
      status: 'error',
      error
    })

  }

}

const GetUser = async (req,res,next) => {

try {

  const page = parseInt(req.query.page);
  const limit = parseInt(req.query.limit) || 10;
  const skip = (page - 1) * limit;

  const findUser = await userModel.find().skip(skip).limit(limit);

  const userToken = req.cookies.token;
  const user = req.session.user;
  console.log("🚀 ~ GetUser ~ user:", user)

  console.log(user);

  res.status(200).json({
    status: 'Login success',
    findUser,
    userToken,
    user
   })
  
} catch (error) {
  
  res.status(500).json({
    status: 'error',
    error
  })

}

}

const logoutUser = async (req,res,next) => {

  try {
  
    res.clearCookie('token');
  
    res.send({ message: 'Logged out successfully' });
    
  } catch (error) {
    
    res.status(500).json({
      status: 'error',
      error
    })
  
  }
  
  }

router.post('/signin', CreateUser);
router.post('/logIn', CheckUser);
router.get('/getUser',auth, GetUser);
router.get('/logout',auth, logoutUser);

module.exports = router;
var express = require('express');
var router = express.Router();
var userModel = require('../model/user');
const auth = require('../middleware/auth');
const jwt = require('jsonwebtoken');
const bcrypt = require('bcrypt');
/* GET users listing. */

const CreateUser =  async (req,res,next) => {

    try {

       const createUser = new userModel({
        username: req.body.username,
        password: req.body.password
       })

       const saveData = await createUser.save();

       res.status(200).json({
        status: 'success',
        saveData
       })

      
    } catch (error) {

      res.status(500).json({
        status: 'error',
        error
      })
      
    }

}

const CheckUser = async (req,res,next) => {

  try {

    const {username , password } = req.body

    const findUser = await userModel.findOne({ username : username})

    if(findUser){

      bcrypt.compare(password, findUser.password, function(err, result) {
        // result == true
        if (result == true) {

          console.log(findUser);

          const token = jwt.sign({ _id: findUser._id }, "JWT_SECRET", { expiresIn: '1h' });
      
          res.cookie('token', token, { httpOnly: true });
          req.session.user = findUser;
      
          res.status(200).json({
            status: 'Login success',
            token
           })
          
        }else {

          res.status(500).json({
            status: 'Password Incorrect',
          })

        }
      });

    }else{

      res.status(500).json({
        status: 'User not Found',
      })

    }
    
  } catch (error) {
    
    res.status(500).json({
      status: 'error',
      error
    })

  }

}

const GetUser = async (req,res,next) => {

try {

  const page = parseInt(req.query.page);
  const limit = parseInt(req.query.limit) || 10;
  const skip = (page - 1) * limit;

  const findUser = await userModel.find().skip(skip).limit(limit);

  const userToken = req.cookies.token;
  const user = req.session.user;
  console.log("🚀 ~ GetUser ~ user:", user)

  console.log(user);

  res.status(200).json({
    status: 'Login success',
    findUser,
    userToken,
    user
   })
  
} catch (error) {
  
  res.status(500).json({
    status: 'error',
    error
  })

}

}

const logoutUser = async (req,res,next) => {

  try {
  
    res.clearCookie('token');
  
    res.send({ message: 'Logged out successfully' });
    
  } catch (error) {
    
    res.status(500).json({
      status: 'error',
      error
    })
  
  }
  
  }

router.post('/signin', CreateUser);
router.post('/logIn', CheckUser);
router.get('/getUser',auth, GetUser);
router.get('/logout',auth, logoutUser);

module.exports = router;
const mongoose = require('mongoose');
const bcrypt = require('bcrypt');

const userSchema = new mongoose.Schema({
    username: 
    {
        type: 'String'
    },
    password:{
        type: 'String'
    }
  });

  userSchema.pre('save',async function (next){

    if(this.isModified('password')){
        this.password = await bcrypt.hash(this.password, 10);
    }
    next();
  })

  const userModel = mongoose.model('User', userSchema);

  module.exports = userModel;
const jwt = require('jsonwebtoken');

function Auth (req, res, next) {

    const token = req.session.token || req.cookies.token;

    if (!token) {
        return res.status(401).send({ error: 'Unauthorized' });
    }

    try {

        const payload = jwt.verify(token, "JWT_SECRET");
        req.user = payload;
        next();
        
    } catch (error) {
        res.status(401).send({ error: 'Unauthorized' });
    }

}

module.exports = Auth;
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/25423296/163456776-7f95b81a-f1ed-45f7-b7ab-8fa810d529fa.png">
  <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/25423296/163456779-a8556205-d0a5-45e2-ac17-42d089e3c3f8.png">
  <img alt="Shows an illustrated sun in light mode and a moon with stars in dark mode." src="https://user-images.githubusercontent.com/25423296/163456779-a8556205-d0a5-45e2-ac17-42d089e3c3f8.png">
</picture>
{
  "associationSubscriptionId": 0,
  "associationMembershipId": 40,
  "title": "premium member",
  "isNational": true,
  "validityInDays": 45,
  "currencyCode": "INR",
  "currencyCountryId": 1,
  "subscriptionFee": 100000,
  "totalFee": 110000,
  "tax": 10,
  "isTaxApplicable": true
}
{
  "fundRaisingId": 0,
  "fundRaisingTypeId": 17,
  "fundRaisingCategoryId": 5,
  "fundRaisingRequestForId": 122,
  "associationMemberId": 362,
  "associationId": 38,
  "title": "Fund raise for charity purpose ",
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
  "currencyCode": "INR",
  "currencyCountryId": 1,
  "targetAmount": 456778,
  "targetEndDate": "2024-09-30T08:15:20.657Z",
  "isTaxBenefitApplicable": true,
  "applicableTaxCode": "TERA3434",
  "videoUrl": null,
  "fundRaiseRejectReason": "fund raise documents must be submitted ",
  "images": [],
  "documents": [],
  "beneficiaryAccountDetails": {
    "fundRaisingBeneficiaryId": 0,
    "fundRaisingId": 0,
    "upiId": "7989824656@ybl",
    "bankingPaymentTypeId": 171
  },
  "beneficiaryDetails": {
    "fundRaisingBeneficiaryId": 0,
    "fundRaisingId": 0,
    "name": "Chukkambotla",
    "emailId": "jayanth@gmail.com",
    "phonecode": "+91",
    "phoneCountryId": 1,
    "phoneNumber": 8956895623,
    "kycType": null,
    "kycTypeId": 0,
    "kycDocumentUrl": null,
    "kycVerificationStatusId": 0,
    "kycVerificationStatus": "string"
  },
  "linkedAsscoiations": [
    {
      "id": 0,
      "associationId": 38,
      "name": "Hdfc Association ",
      "logoUrl": null
    }
  ]
}
{
  "fundRaisingId": 0,
  "fundRaisingTypeId": 17,
  "fundRaisingCategoryId": 5,
  "fundRaisingRequestForId": 122,
  "associationMemberId": 362,
  "associationId": 38,
  "title": "Fund raise for charity purpose ",
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
  "currencyCode": "INR",
  "currencyCountryId": 1,
  "targetAmount": 456778,
  "targetEndDate": "2024-09-30T08:15:20.657Z",
  "isTaxBenefitApplicable": true,
  "applicableTaxCode": "TERA3434",
  "videoUrl": null,
  "fundRaiseRejectReason": "fund raise documents must be submitted ",
  "images": [],
  "documents": [],
  "beneficiaryAccountDetails": {
    "fundRaisingBeneficiaryId": 0,
    "fundRaisingId": 0,
    "upiId": "7989824656@ybl",
    "bankingPaymentTypeId": 171
  },
  "beneficiaryDetails": {
    "fundRaisingBeneficiaryId": 0,
    "fundRaisingId": 0,
    "name": "Chukkambotla",
    "emailId": "jayanth@gmail.com",
    "phonecode": "+91",
    "phoneCountryId": 1,
    "phoneNumber": 8956895623,
    "kycType": null,
    "kycTypeId": 0,
    "kycDocumentUrl": null,
    "kycVerificationStatusId": 0,
    "kycVerificationStatus": "string"
  },
  "linkedAsscoiations": [
    {
      "id": 0,
      "associationId": 38,
      "name": "Hdfc Association ",
      "logoUrl": null
    }
  ]
}
let rawPrize = prompt("Enter your first name");

​
let b = 0;      // b contains 0

b += 1;         // b contains 1

b++;            // b contains 2

console.log(b); // Shows 2

​
const nb = Number(prompt("Enter a number:")); // nb's type is number
body {
  background: black;
}

.StyledReceipt {
  background-color: #fff;
  width: 22rem;
  position: relative;
  padding: 1rem;
  box-shadow: 0 -0.4rem 1rem -0.4rem rgba(0, 0, 0, 0.2);
}

.StyledReceipt::after {
  background-image: linear-gradient(135deg, #fff 0.5rem, transparent 0),
    linear-gradient(-135deg, #fff 0.5rem, transparent 0);
  background-position: left-bottom;
  background-repeat: repeat-x;
  background-size: 1rem;
  content: '';
  display: block;
  position: absolute;
  bottom: -1rem;
  left: 0;
  width: 100%;
  height: 1rem;
}
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';

import 'api_exceptions.dart';

enum FirebaseApiFilterType {
  isEqualTo,
  isNotEqualTo,
  isGreaterThan,
  isGreaterThanOrEqualTo,
  isLessThan,
  isLessThanOrEqualTo,
  arrayContains,
  arrayContainsAny,
  whereIn,
  whereNotIn,
  isNull,
}

class FirebaseFilterEntity {
  final String field;
  final FirebaseApiFilterType operator;
  final dynamic value;

  FirebaseFilterEntity({
    required this.field,
    required this.operator,
    required this.value,
  });
}

abstract class FirebaseApiClient {
  Future<dynamic> get(String collection,{int limit = 20 ,List<FirebaseFilterEntity>? filters});
  Future<dynamic> getById(String collection, String id);
  Future<dynamic> postWithId(String collection, {required Map<String, dynamic> params});
  Future<void> post(String collection, {required String id, required Map<String, dynamic> params});
  Future<void> putWithId(String collection, {required String id, required Map<String, dynamic> params});
  Future<void> put(String collection, {required Map<String, dynamic> params});
  Future<void> deleteDoc(String collection, String id);
}

class FirebaseApiClientImpl extends FirebaseApiClient {
  final FirebaseFirestore _client;

  FirebaseApiClientImpl(this._client);

  @override
  Future<dynamic> get(String collection,{int limit = 20 ,List<FirebaseFilterEntity>? filters}) async {
    try {
      Query query = _client.collection(collection);

      if (filters != null) {
        for (var filter in filters) {
          switch (filter.operator) {
            case FirebaseApiFilterType.isEqualTo:
              query = query.where(filter.field, isEqualTo: filter.value);
              break;
            case FirebaseApiFilterType.isNotEqualTo:
              query = query.where(filter.field, isNotEqualTo: filter.value);
              break;
            case FirebaseApiFilterType.isGreaterThan:
              query = query.where(filter.field, isGreaterThan: filter.value);
              break;
            case FirebaseApiFilterType.isGreaterThanOrEqualTo:
              query = query.where(filter.field, isGreaterThanOrEqualTo: filter.value);
              break;
            case FirebaseApiFilterType.isLessThan:
              query = query.where(filter.field, isLessThan: filter.value);
              break;
            case FirebaseApiFilterType.isLessThanOrEqualTo:
              query = query.where(filter.field, isLessThanOrEqualTo: filter.value);
              break;
            case FirebaseApiFilterType.arrayContains:
              query = query.where(filter.field, arrayContains: filter.value);
              break;
            case FirebaseApiFilterType.arrayContainsAny:
              query = query.where(filter.field, arrayContainsAny: filter.value);
              break;
            case FirebaseApiFilterType.whereIn:
              query = query.where(filter.field, whereIn: filter.value);
              break;
            case FirebaseApiFilterType.whereNotIn:
              query = query.where(filter.field, whereNotIn: filter.value);
              break;
            case FirebaseApiFilterType.isNull:
              query = query.where(filter.field, isNull: filter.value);
              break;
            default:
              throw ArgumentError('Unsupported operator: ${filter.operator}');
          }
        }
      }

      final response = await query.limit(limit).get();
      return response.docs.map((doc) => doc.data()).toList();
    } catch (e) {
      throw _handleError(e, tr('errorGettingDataCollection'));
    }
  }

  @override
  Future<dynamic> getById(String collection, String id) async {
    try {
      final response = await _client.collection(collection).doc(id).get();
      if (!response.exists) {
        throw Exception('Document with ID $id not found in collection $collection');
      }
      return response.data();
    } catch (e) {
      throw _handleError(e, tr('errorGettingDocumentById'));
    }
  }

  @override
  Future<void> put(String collection, {required Map<String, dynamic> params}) async {
    if (!params.containsKey('id')) {
      throw ArgumentError(tr('documentIdIsRequiredToUpdate'));
    }
    try {
      await _client.collection(collection).doc(params['id']).update(params);
    } catch (e) {
      throw _handleError(e, tr('errorUpdatingDocument'));
    }
  }

  @override
  Future<void> deleteDoc(String collection, String id) async {
    try {
      await _client.collection(collection).doc(id).delete();
    } catch (e) {
      throw _handleError(e, tr('errorDeletingDocument'));
    }
  }

  Exception _handleError(dynamic error, String defaultMessage) {
    if (error is FirebaseException) {
      switch (error.code) {
        case 'permission-denied':
          return UnauthorisedException();
        case 'not-found':
          return Exception(defaultMessage);
        default:
          return ExceptionWithMessage('$defaultMessage: ${error.message}');
      }
    }
    return Exception(defaultMessage);
  }

  @override
  Future<void> post(String collection, {required String id, required Map<String, dynamic> params}) async {
    try {
      await _client.collection(collection).doc(id).set(params);
    } catch (e) {
      throw _handleError(e, tr('errorPostingDataCollection'));
    }
  }


  @override
  Future<dynamic> postWithId(String collection, {required Map<String, dynamic> params}) async {
    try {
      debugPrint("Post data $collection\n$params");
      await _client.collection(collection).doc(params['id']).set(params);
      return params;
    } catch (e) {
      throw _handleError(e, tr('errorPostingDataCollection'));
    }
  }


  @override
  Future<void> putWithId(String collection, {required String id, required Map<String, dynamic> params}) async {
    try {
      await _client.collection(collection).doc(id).update(params);
    } catch (e) {
      throw _handleError(e, tr('errorUpdatingDocument'));
    }
  }
}
console.log("Hello from JavaScript!");

console.log("Let's do some math");

console.log( + 7);
4
console.log(12 / 0);

console.log("Goodbye!");

​
console.log("Hello from JavaScript!");

console.log("Let's do some math");

console.log( + 7);
4
console.log(12 / 0);

console.log("Goodbye!");

​
console.log("Hello from JavaScript!");

console.log("Let's do some math");

console.log( + 7);
4
console.log(12 / 0);

console.log("Goodbye!");

​
while IFS=';' read -r username groups; do
    # Remove whitespace
    username=$(echo "$username" | xargs)
    groups=$(echo "$groups" | xargs)

    # Create user and personal group
    if id "$username" &>/dev/null; then
        echo "User $username already exists." | tee -a "$LOG_FILE"
    else
        useradd -m -s /bin/bash -G "$groups" "$username"
        echo "User $username created." | tee -a "$LOG_FILE"
        
        # Create a random password
        password=$(openssl rand -base64 12)
        echo "$username:$password" | chpasswd
        echo "$username,$password" >> "$PASSWORD_FILE"

        # Set up home directory permissions
        chown "$username:$username" "/home/$username"
        chmod 700 "/home/$username"

        echo "User $username added to groups: $groups" | tee -a "$LOG_FILE"
    fi
done < "$USER_FILE"
    const renderTitle = () => (
      <span style={{display:'flex',justifyContent:'space-between'}}>
        <span>Name</span>
        {/* <span>Code</span> */}
        <span>Balance</span>
      </span>
    );
    const renderItem = (ledger_id,ledger_code, name, balance) => ({
      key: ledger_id,
      value: name,
      label: (
        <div
          style={{
            display: 'flex',
            justifyContent: 'space-between',
          }}
        >
          <span>
             {name}
          </span>
          {/* <span>
          {ledger_code}
          </span> */}
          <span>
             {balance}
          </span>
        </div>
      ),
    });


const handleSearch = (search, type) => {
        console.log("type====>",type);
        console.log("search====>",search);
        if(type === 'ledger'){
          fetchLedger(search).then((data) =>{
            console.log("data--newone==>",data);
            const fetchedOptions = data.map((item) => renderItem(item.ledger_id, item.ledger_code, item.value, item.current_balance));
            setLedgerList([
              {
                label: renderTitle(),
                options: fetchedOptions
              }
            ])
          })
        }
    }

    const handleChange = async(value,option, name) => {
      // const updatedData = props.dataSource.map(item => {
        console.log("value===>",value);
        console.log("option===>",option);
        console.log("option.key===>",option.key);
        console.log("name===>",name);
        if (name === 'ledger'){
          const response = await api.post(`${dotzURL}ledger/ledger-basic/`,{organization:orgId,ledger_id:option.key})
          console.log("response---->",response.data.data);
          const ledgerData = response.data.data
          setState((prevState) => ({
            ...prevState,
            ledgerId: ledgerData.id,
            name: ledgerData.value,
            code : ledgerData.ledger_code,
            balance : ledgerData.current_balance
          }));
        }
    };

-----------------------

<AutoComplete
            options={ledgerList}
            size="large"
            style={{
            width: '100%',
            }}
            onSearch={(text) => handleSearch(text, 'ledger')}
            onSelect={(value, option) => handleChange(value,option, 'ledger')}

            placeholder="Select Customer"
            defaultValue={state.name}
            autoFocus
            allowClear
        />
          class Demo{
               public static void main(String[] args){
                    system.out.printLn("Hello World");
               }
          }
     
          class Demo{
               public static void main(String[] args){
                    system.out.printLn("Hello World");
               }
          }
     
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
.iconsWithHeadingTextBoxed-2 .carousel-slide .upperSection .h6 {
    font-size: 21px;
    letter-spacing: 0;
    font-weight: 700;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .upperSection .h6, .iconsWithHeadingTextBoxed-2 .carousel-slide .upperSection h3 {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    top: 70%;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
}

.iconsWithHeadingTextBoxed-2 .gap {
    display: flex;
    grid-gap: 1%;
    gap: 1%;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide {
    width: 100%;
    min-height: 470px;
    height: auto;
    border-radius: 15px;
    margin: 65px 10px 60px;
    box-shadow: var(--mdc-fab-box-shadow, 0 3px 5px -1px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12));
}

.iconsWithHeadingTextBoxed-2 .carousel-slide.border-yellow .upperSection .imgBox {
    border: 4px solid #f1bb31;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide.border-green .upperSection .imgBox {
    border: 4px solid #c2b925;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide.border-red .upperSection .imgBox {
    border: 4px solid #f07d6d;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide.border-orange .upperSection .imgBox {
    border: 4px solid #f07530;
}

.iconsWithHeadingTextBoxed-2 .carousel-slide .upperSection {
    position: relative;
    height: 120px;
    border-radius: 15px 15px 0 0;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide.border-orange .upperSection {
    background-color: #f07530;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide.border-yellow .upperSection {
    background-color: #f1bb31;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide.border-green .upperSection {
    background-color: #c2b925;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide.border-red .upperSection {
    background-color: #f07d6d;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .contentSection {
    font-size: 14px;
    line-height: 1;
    font-weight: 300;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .upperSection .imgBox {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: #fff;
    height: 110px;
    width: 110px;
    padding: 2px;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide {
    width: 100%;
    min-height: 470px;
    height: auto;
    border-radius: 15px;
    margin: 65px 10px 60px;
    box-shadow: var(--mdc-fab-box-shadow, 0 3px 5px -1px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12));
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .contentSection li {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .contentSection li .data {
    flex: 85% 1;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .contentSection {
    font-size: 14px;
    line-height: 1;
    font-weight: 300;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .contentSection {
    padding: 10px;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .upperSection .h6 {
    font-size: 21px;
    letter-spacing: 0;
    font-weight: 700;
}
.icon img {
    height: 20px;
    margin-right: 10px;
}
.imgBox img {
    padding: 25px;
}
.iconsWithHeadingTextBoxed-2 .carousel-slide .upperSection {
    position: relative;
    height: 128px;
    border-radius: 15px 15px 0 0;
    margin-top: -20px;
}
.data {
    color: #4f505a;
}
.innerBox {
    padding: 100px;
}

</style>
<body>
    <div class="container">
    <div class="iconsWithHeadingTextBoxed-2">
        <div class="innerBox">
            <h2 class="sectionHeading"></h2>
            <div class="carousel-slides gap">
                <div class="border-orange carousel-slide">
                    <div class="upperSection">
                        <div class="imgBox"><span class=" lazy-load-image-background blur lazy-load-image-loaded"
                                style="color: transparent; display: inline-block;"><img alt="2 Weeks"
                                    src="https://d3l6fpccohjkcc.cloudfront.net/static/media/week2.e2571e85.svg"></span>
                        </div>
                        <h3 class="h6">2 Weeks</h3>
                        <h2></h2>
                    </div>
                    <ul class="contentSection">
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Pre-built WordPress / WooCommerce theme incorporating brand guidelines and
                                basic layout changes.</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">WordPress / WooCommerce app consultation and integrations (Upto 4 apps
                                from WordPress / WooCommerce App Store with UI tweaks as per brand guidelines).</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Data migration / Catalog Setup Support into WordPress / WooCommerce (data
                                formatting isn't included)</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">WordPress / WooCommerce Scripts (basic complexity)</div>
                        </li>
                    </ul>
                </div>
                <div class="border-yellow carousel-slide">
                    <div class="upperSection">
                        <div class="imgBox"><span class=" lazy-load-image-background blur lazy-load-image-loaded"
                                style="color: transparent; display: inline-block;"><img alt="4 Weeks"
                                    src="https://d3l6fpccohjkcc.cloudfront.net/static/media/week4.8fda8454.svg"></span>
                        </div>
                        <h3 class="h6">4 Weeks</h3>
                        <h2></h2>
                    </div>
                    <ul class="contentSection">
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Pre-built WordPress / WooCommerce theme incorporating brand guidelines
                                &amp; moderate layout changes + 1 new layout.</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">WordPress / WooCommerce app consultation and integrations (Upto 8 apps
                                with UI tweaks as per brand guidelines and moderate layout changes).</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Data migration / Catalog Setup (includes data formatting).</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">WordPress / WooCommerce Scripts (moderate complexity).</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Upto 2 clone stores (for geographical expansion - different catalog,
                                prices, shipment and tax rules).</div>
                        </li>
                    </ul>
                </div>
                <div class="border-green carousel-slide">
                    <div class="upperSection">
                        <div class="imgBox"><span class=" lazy-load-image-background blur lazy-load-image-loaded"
                                style="color: transparent; display: inline-block;"><img alt="8 Weeks"
                                    src="https://d3l6fpccohjkcc.cloudfront.net/static/media/week8.4342d9f6.svg"></span>
                        </div>
                        <h3 class="h6">8 Weeks</h3>
                        <h2></h2>
                    </div>
                    <ul class="contentSection">
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Pre-built WordPress / WooCommerce theme incorporating your brand
                                guidelines and extensive layout changes + up to 3 new layouts.</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">WordPress / WooCommerce app consultation and integrations (Upto 20 apps
                                from WordPress / WooCommerce App Store with UI tweaks as per brand guidelines and
                                moderate layout changes).</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Data migration / Catalog Setup into WordPress / WooCommerce (includes data
                                formatting and WordPress / WooCommerce scripts development for migrating data).</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">WordPress / WooCommerce Scripts (advanced complexity).</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Upto 4 clone stores for your WordPress / WooCommerce store (for
                                geographical expansion - different catalog, prices, shipment and tax rules).</div>
                        </li>
                    </ul>
                </div>
                <div class="border-red carousel-slide">
                    <div class="upperSection">
                        <div class="imgBox"><span class=" lazy-load-image-background blur lazy-load-image-loaded"
                                style="color: transparent; display: inline-block;"><img alt="Not in a rush ?"
                                    src="https://d3l6fpccohjkcc.cloudfront.net/static/media/no-rush.94dc28f8.svg"></span>
                        </div>
                        <h3 class="h6">Not in a rush ?</h3>
                        <h2></h2>
                    </div>
                    <ul class="contentSection">
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Custom WordPress / WooCommerce template (unlimited layouts).</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Headless architecture supported by WordPress / WooCommerce.</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Custom WordPress / WooCommerce App Development for any business logic not
                                supported by WordPress / WooCommerce or apps from WordPress / WooCommerce App store.
                            </div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Unlimited clone stores for your WordPress / WooCommerce store.</div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">ADA Compliance to make your WordPress / WooCommerce store accessible.
                            </div>
                        </li>
                        <li>
                            <div class="icon"><img
                                    src="https://stageportfoilo.com/wp/contechtive/wp-content/uploads/2024/06/images-removebg-preview.png"
                                    alt="tick"></div>
                            <div class="data">Mobile Application supported by your WordPress / WooCommerce Store.</div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
</body>

</html>
ddev magento cache:clean
ddev magento cache:flush
rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* pub/static/frontend/* pub/static/adminhtml/* pub/static/_cache/*
<!DOCTYPE html>
<html class="no-js" lang="{{ locale_name }}">
    <head>
        <title>{{ head.title }}</title>
        {{{ resourceHints }}}
        {{{ head.meta_tags }}}
        {{{ head.config }}}
        {{#block "head"}} {{/block}}

        <link href="{{ head.favicon }}" rel="shortcut icon">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <script>
            {{!-- Change document class from no-js to js so we can detect this in css --}}
            document.documentElement.className = document.documentElement.className.replace('no-js', 'js');
        </script>

        {{> components/common/polyfill-script }}
        <script>window.consentManagerTranslations = `{{{langJson 'consent_manager'}}}`;</script>

        {{!-- Load Lazysizes script ASAP so images will appear --}}
        <script>
            {{!-- Only load visible elements until the onload event fires, after which preload nearby elements. --}}
            window.lazySizesConfig = window.lazySizesConfig || {};
            window.lazySizesConfig.loadMode = 1;
        </script>
        <script async src="{{cdn 'assets/dist/theme-bundle.head_async.js' resourceHint='preload' as='script'}}"></script>

        <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>

        <script>
            WebFont.load({
                custom: {
                    families: ['Karla', 'Roboto', 'Source Sans Pro']
                },
                classes: false
            });
        </script>


        {{ getFontsCollection }}
        {{{stylesheet '/assets/css/theme.css'}}}
        {{{stylesheet '/assets/css/vault.css'}}}
        {{{stylesheet '/assets/css/custom.css'}}}

        {{{head.scripts}}}

        {{~inject 'zoomSize' theme_settings.zoom_size}}
        {{~inject 'productSize' theme_settings.product_size}}
        {{~inject 'showAdminBar' theme_settings.show-admin-bar}}
        {{~inject 'genericError' (lang 'common.generic_error')}}
        {{~inject 'maintenanceModeSettings' settings.maintenance}}
        {{~inject 'adminBarLanguage' (langJson 'admin')}}
        {{~inject 'urls' urls}}
        {{~inject 'secureBaseUrl' settings.secure_base_url}}
        {{~inject 'cartId' cart_id}}
        {{~inject 'channelId' settings.channel_id}}
        {{~inject 'template' template}}
        {{~inject 'validationDictionaryJSON' (langJson 'validation_messages')}}
        {{~inject 'validationFallbackDictionaryJSON' (langJson 'validation_fallback_messages')}}
        {{~inject 'validationDefaultDictionaryJSON' (langJson 'validation_default_messages')}}
        {{~inject 'carouselArrowAndDotAriaLabel' (lang 'carousel.arrow_and_dot_aria_label')}}
        {{~inject 'carouselActiveDotAriaLabel' (lang 'carousel.active_dot_aria_label')}}
        {{~inject 'carouselContentAnnounceMessage' (lang 'carousel.content_announce_message')}}
    </head>
    <body>
      <!-- ACTIVE SHOPNAV DIM PAGE -->
      <div id="shopnav-dim-page" style="display: none;">
        <div style="top: 50%; left: 50%; display: none;" id="dialog" class="window">
          <div id="san"></div>
        </div>
        <div style="width: 2478px; font-size: 32pt; color:white; height: 1202px; display: none; opacity: 0.4;" id="mask"></div>
      </div>
      <!-- END ACTIVE SHOPNAV DIM PAGE -->
      <svg data-src="{{cdn 'img/icon-sprite.svg'}}" class="icons-svg-sprite"></svg>

      {{> components/common/header }}
      <!--{{> components/common/body }}-->
    <div class="container">
        {{{region name="add_widget_here"}}}
          {{{region name="add_Global_widget_here--global"}}}
          {{{page_content}}}
    </div>
    
    
<!--    <div class="body" data-currency-code="{{currency_selector.active_currency_code}}">-->
<!--    {{#block "hero"}} {{/block}}-->
<!--    <div class="container">-->
<!--        {{#block "page"}} {{/block}}-->
<!--    </div>-->
<!--    {{> components/common/modal/modal}}-->
<!--    {{> components/common/alert/alert-modal}}-->
<!--</div>-->



      {{> components/common/footer }}

      <script>window.__webpack_public_path__ = "{{cdn 'assets/dist/'}}";</script>
      <script src="{{cdn 'assets/dist/theme-bundle.main.js'}}"></script>
      <script>
          {{!-- Exported in app.js --}}
          window.stencilBootstrap("{{page_type}}", {{jsContext}}).load();
      </script>

      {{{footer.scripts}}}
  </body>
</html>
Now you need to actually sort the array. The first sorting algorithm you will implement is the bubble sort, which starts at the beginning of the array and 'bubbles up' unsorted values towards the end, iterating through the array until it is completely sorted.

const bubbleSort = (array) => {
  for (let i = 0; i < array.length; i++) {
    for (let j = 0; j < array.length - 1; j++) {
      console.log(array, array[j], array[j + 1]);

      if (array[j] > array[j + 1]) {
        const temp = array[j];
        array[j] = array[j + 1];
        array[j + 1] = temp;
      }
    }
  }

  return array;
}
  
  Time to implement another sorting algorithm. This time, you'll be implementing a selection sort. Selection sort works by finding the smallest value in the array, then swapping it with the first value in the array. Then, it finds the next smallest value in the array, and swaps it with the second value in the array. It continues iterating through the array until it is completely sorted.
  
const selectionSort = (array) => {
  for (let i = 0; i < array.length; i++) {
    let minIndex = i;

    for (let j = i + 1; j < array.length; j++) {
      console.log(array, array[j], array[minIndex]);
      if (array[j] < array[minIndex]) {
        minIndex = j;
      }
    }

    const temp = array[i];
    array[i] = array[minIndex];
    array[minIndex] = temp;
  }

  return array;
}

The last sorting algorithm you will implement is the insertion sort. This algorithm works by building up a sorted array at the beginning of the list. It begins the sorted array with the first element. Then it inspects the next element and swaps it backward into the sorted array until it is in a sorted position, and so on.

const insertionSort = (array) => {
  for (let i = 1; i < array.length; i++) {
    const currValue = array[i];
    let j = i - 1;

    while (j >= 0 && array[j] > currValue) {
      array[j + 1] = array[j];
      j--;
    }
    array[j + 1] = currValue;
  }
  return array;
}

To sort the elements of an array, you can use the built-in method called .sort(). 

Notice how the double digit number(10) is placed at the beginning of the array. This is because the default behavior of .sort() is to convert the numbers values to strings, and sort them alphabetically. And 10 comes before 2 alphabetically.

To fix this, you can pass a callback function to the .sort() method. The callback function has two parameters - for yours, use a and b. The parameters of a and b represent the number values in the array that will be sorted.

const sortedValues = inputValues.sort((a, b) => {
    return a - b;
  });
These young ladies have obviously already been victims of perverted voyeurs. 
It is now my job to find out who these perverts were and to punish them accordingly.

Sie ist die, die sich ein jeder Wichser und Spermaspritzer 
für seinen Schwanz erträumt!
Wie seht ihr das?

Welcher Wichser träumt nicht davon, von solch einer Göre mit den Worten:
"Wichst du für mich, bitte?"
zum wichsen und rumspritzen eingeladen zu werden
{
  "userId": 858,
  "firstName": "kiran",
  "lastName": "Reddy",
  "phoneCode": "+91",
  "phoneCountryId": 1,
  "phoneNumber": 9000989326,
  "emailId": "Kiranreddy@gmail.com",
  "profilePicUrl": "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/Profile/ea008f89-872b-496a-9a60-925a8c721f01.jpg"
}
from docx import Document
import pandas as pd

df = pd.read_csv('out.csv').to_dict()
word_doc = Document()

table_head = list(df.keys())

table_head_len = len(table_head)
tables_rows_len = len(df['name'])

# create tabel
table = word_doc.add_table(cols = table_head_len, rows = tables_rows_len)

# add the first row in the table
for i in range(table_head_len):
    table.cell(row_idx = 0, col_idx = i).text = table_head[i]


# add rows for name col
for i in range(1, tables_rows_len):
    table.cell(row_idx = i, col_idx = 0).text = df['name'][i]


# add rows for age col
for i in range(1, tables_rows_len):
    table.cell(row_idx = i, col_idx = 1).text = str(df['age'][i])


word_doc.save('word_doc.docx')
<?php
/**
 * The Template for displaying product archives, including the main shop page which is a post type archive
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerce\Templates
 * @version 3.4.0
 */

defined( 'ABSPATH' ) || exit;

get_header( 'shop' );

/**
 * Hook: woocommerce_before_main_content.
 *
 * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
 * @hooked woocommerce_breadcrumb - 20
 * @hooked WC_Structured_Data::generate_website_data() - 30
 */
do_action( 'woocommerce_before_main_content' );

?>
<div class="container-fluid">
<header class="woocommerce-products-header">
	<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
		<h1 class="woocommerce-products-header__title page-title"><?php woocommerce_page_title(); ?></h1>
	<?php endif; ?>

	<?php
	/**
	 * Hook: woocommerce_archive_description.
	 *
	 * @hooked woocommerce_taxonomy_archive_description - 10
	 * @hooked woocommerce_product_archive_description - 10
	 */
	do_action( 'woocommerce_archive_description' );
	?>
</header>

<div class="row">
	<div class="col-lg-3">
		<?php
		/**
		 * Hook: woocommerce_sidebar.
		 *
		 * @hooked woocommerce_get_sidebar - 10
		 */
		do_action( 'woocommerce_sidebar' );
		?>
	</div>
	<div class="col-lg-9">


<?php
if ( woocommerce_product_loop() ) {

	/**
	 * Hook: woocommerce_before_shop_loop.
	 *
	 * @hooked woocommerce_output_all_notices - 10
	 * @hooked woocommerce_result_count - 20
	 * @hooked woocommerce_catalog_ordering - 30
	 */
	do_action( 'woocommerce_before_shop_loop' );

	woocommerce_product_loop_start();

	if ( wc_get_loop_prop( 'total' ) ) {
		while ( have_posts() ) {
			the_post();

			/**
			 * Hook: woocommerce_shop_loop.
			 */
			do_action( 'woocommerce_shop_loop' );

			wc_get_template_part( 'content', 'product' );
		}
	}

	woocommerce_product_loop_end();

	/**
	 * Hook: woocommerce_after_shop_loop.
	 *
	 * @hooked woocommerce_pagination - 10
	 */
	do_action( 'woocommerce_after_shop_loop' );
} else {
	/**
	 * Hook: woocommerce_no_products_found.
	 *
	 * @hooked wc_no_products_found - 10
	 */
	do_action( 'woocommerce_no_products_found' );
}

/**
 * Hook: woocommerce_after_main_content.
 *
 * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
 */
do_action( 'woocommerce_after_main_content' );

?>
	</div>
</div>
</div>
<?php

get_footer( 'shop' );

?>
Hello Customers..*Are you having troubles meeting up with you BILLS*Do you need capital to begin a small or large scale BUSINESS*Do you need EXCESS funds for PERSONAL USE*Are you suffering from health issues and you need FINANCING*Do you need a raise for that SCHOOL FEES*An improved CREDIT to apply for a LOANThis is JEANSON ANCHETA Underground ANONYMOUS Hacker providing service to customer with REAL needs at a minimal cost.. i have been underground for years now i am currently trading Bitcoin for FRESH BASE TOOLS including Hacked PayPal logs, Bank Wire & Ach logins, Wu transfer and Bug software, Credit card Top-Up, Fullz, Clone Atm skimmer, Cvv, smtp, rdp, inbox mailer, Email leads, Dumps and Warez with several Bots and Hacking tools strictly UNDERGROUND Sales.. I am selling FRESH BASE TOOLS Hacked WU Bug software and MTCN, Verizon, AT&T account, Transferwise, Hacked PayPal accounts, Bank wire logins, Money Booker, Skrill account, cc top-up, fullz, dumps+pin leads, rdp, smtp, email leads..CONTACT

G/MAIL: Jeansonancheta0518@gmail.com

WHATSAPP: +1-209-442-6951

TELEGRAM: +1-209-442-6951


https://t.me/+2__ynBAtFP00M2Fk 

All transactions are carried out offshore and has no trace backs or charge-backs here are the Rates List with Explanation :-
Western Union Transfer :-Transferring Western Union all over the world and it takes 10 - 30 minutes maximum to receive MTCN and senders info then you can pick up funds from Western union Store. (transferring all over the world)Necessary Info needed for WU transfers :-1: Full name2: Cell number (Not Necessary)3: City4:Country Western Union Transfer Rates :$1500 Transfer = $200$3000 Transfer = $300$4500 Transfer = $400$7000 Transfer = $500$10000 Transfer = $700Bank Transfers :- My responsibility is to transfer the required amount into your account after your payment from my spammed logins, we have method for making clear payment so no dispute no charge-back chances. (transferring all over the world)Info needed for Bank transfers :-1: Bank name2: Bank address3: Zip code4: Account Holder Name5: Account number6: Account Type7: Routing number Bank transfer will take maximum 3 hours for reflection..Transfer Rates :$3000 Transfer = $250 Charges$5000 Transfer = $400 Charges$9000 Transfer = $700 Charges$12000 Transfer = $1000 Charges$15000 Transfer = $1200 ChargesPayPal Transfer :- Using Verified PayPal accounts to transfer funds. This is a safe way to earn money. (transferring all over the world except banned/blacklisted countries)PayPal Transfer Rates :$3000 Transfer = $250 Charges$5000 Transfer = $400 Charges$9000 Transfer = $700 Charges$15,000 Transfer = $1200 ChargesCredit-card Top Up Rates:-$3000 Transfer = $300 Charges$5000 Transfer = $400 Charges$10,000 Transfer = $700 Charges***TERMS AND CONDITIONSA person can receive transfer as much as you desire in a week as long as you can handle your end. If anyone want to do regular business with me then you must have more than one bank account, PayPal, Money Booker and fake ids for western union. You are advised to have a safe account to transfer funds to and also withdraw for cash or make purchases online.PAYMENT METHODS INCLUDE: [ BITCOIN, ETHEREUM, PERFECT MONEY, ITUNES GIFT CARD, WESTERN UNION TRF, MONEY GRAM ]CONTACT

G/MAIL: Jeansonancheta0518@gmail.com

WHATSAPP: +1-209-442-6951

TELEGRAM: +1-209-442-6951



https://t.me/+2__ynBAtFP00M2Fk     
VERIFIED                                                *****100% SECURED*****                                                                   ADMIN                                                        (C) RESERVED 2024
<style>
.systeme-show-popup-828168 {
  background-color: #007bff; /* Change the background color */
  color: white; /* Change the text color */
  padding: 10px 20px; /* Adjust padding */
  border: none; /* Remove border */
  border-radius: 5px; /* Round the corners */
  cursor: pointer; /* Change cursor to pointer */
  text-decoration: none; /* Remove underline */
}
</style>
// always start with a function expression for the function passed into the event

const showAlert = function(e){
  		alert('Do something cool')
  		// then remove the listener
  		btn.removeEventListener(showAlert)
}

btn.addEventListener('mouseenter', showAlert)
// the oldler way
function heroBtnScroll() {

  const featuresEl = document.querySelector('#section--1');   // target element
  const featuresElPosition = featuresEl.getBoundingClientRect(); // element positioned
  console.log(featuresElPosition);
  const { top, left } = featuresElPosition; //destructure to get positions from the getBoundingClientRect()
  window.scrollTo({
    left: left,
    top: top + window.scrollY,
    behavior: 'smooth',
  });
}
const heroBtn = document.querySelector('.btn--scroll-to');
if (heroBtn) {
  heroBtn.addEventListener('click', heroBtnScroll);
}



//the newer way using scrollIntoView

function heroBtnScroll() {
  const featuresEl = document.querySelector('#section--1');
  featuresEl.scrollIntoView({ behavior: 'smooth' });
}

const heroBtn = document.querySelector('.btn--scroll-to');
if (heroBtn) {
  heroBtn.addEventListener('click', heroBtnScroll);
}




// testing scrolling behaviours with the document and the viewport in the console
window.addEventListener('scroll', () => {
  console.log('Viewport height:', document.documentElement.clientHeight);
  console.log('Vertical scroll position:', window.scrollY);
});
let heightStr = '56.54px';

let number = parseFloat(heightStr.replace('px', ''));
console.log(number)

// or on a DOM Element

 const message = document.querySelector('.message-container');
 console.log(getComputedStyle(message).height);
message.style.height =
    Number.parseFloat(getComputedStyle(message).height, 10) + 22.5 + 'px';
[02-Jul-2024 01:06:23 UTC] PHP Fatal error Uncaught Automatic_CSS\ScssPhp\Exception\SassScriptException: Incompatible units ex and px. in /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Node/Number.php:687

Stack trace:

#0 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Node/Number.php(641): Automatic_CSS\ScssPhp\Node\Number->valueInUnits()
#1 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Node/Number.php(618): Automatic_CSS\ScssPhp\Node\Number->coerceUnits()
#2 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Node/Number.php(453): Automatic_CSS\ScssPhp\Node\Number->coerceNumber()
#3 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(4058): Automatic_CSS\ScssPhp\Node\Number->plus()
#4 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(3581): Automatic_CSS\ScssPhp\Compiler->opAddNumberNumber()
#5 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(3627): Automatic_CSS\ScssPhp\Compiler->reduce()
#6 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(3650): Automatic_CSS\ScssPhp\Compiler->reduce()
#7 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(3012): Automatic_CSS\ScssPhp\Compiler->reduce()
#8 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2411): Automatic_CSS\ScssPhp\Compiler->compileChild()
#9 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(5782): Automatic_CSS\ScssPhp\Compiler->compileChildrenNoReturn()
#10 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2736): Automatic_CSS\ScssPhp\Compiler->importFile()
#11 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2948): Automatic_CSS\ScssPhp\Compiler->compileImport()
#12 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2411): Automatic_CSS\ScssPhp\Compiler->compileChild()
#13 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(5782): Automatic_CSS\ScssPhp\Compiler->compileChildrenNoReturn()
#14 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2736): Automatic_CSS\ScssPhp\Compiler->importFile()
#15 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2948): Automatic_CSS\ScssPhp\Compiler->compileImport()
#16 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2411): Automatic_CSS\ScssPhp\Compiler->compileChild()
#17 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(5782): Automatic_CSS\ScssPhp\Compiler->compileChildrenNoReturn()
#18 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2736): Automatic_CSS\ScssPhp\Compiler->importFile()
#19 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2948): Automatic_CSS\ScssPhp\Compiler->compileImport()
#20 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(2411): Automatic_CSS\ScssPhp\Compiler->compileChild()
#21 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(767): Automatic_CSS\ScssPhp\Compiler->compileChildrenNoReturn()
#22 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php(545): Automatic_CSS\ScssPhp\Compiler->compileRoot()
#23 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/CSS_Engine/CSS_File.php(377): Automatic_CSS\ScssPhp\Compiler->compileString()
#24 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/CSS_Engine/CSS_File.php(302): Automatic_CSS\CSS_Engine\CSS_File->get_css_from_scss()
#25 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/Framework/Base.php(71): Automatic_CSS\CSS_Engine\CSS_File->save_file_from_variables()
#26 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/CSS_Engine/CSS_Engine.php(167): Automatic_CSS\Framework\Base->generate_own_css_files()
#27 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/CSS_Engine/CSS_Engine.php(146): Automatic_CSS\CSS_Engine\CSS_Engine->generate_all_css_files()
#28 /home/forestnation/web/staging.forestnation.com/public/wp-includes/class-wp-hook.php(324): Automatic_CSS\CSS_Engine\CSS_Engine->update_framework_css_files()
#29 /home/forestnation/web/staging.forestnation.com/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#30 /home/forestnation/web/staging.forestnation.com/public/wp-includes/plugin.php(517): WP_Hook->do_action()
#31 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/Plugin.php(112): do_action()
#32 /home/forestnation/web/staging.forestnation.com/public/wp-includes/class-wp-hook.php(324): Automatic_CSS\Plugin->activate_plugin()
#33 /home/forestnation/web/staging.forestnation.com/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#34 /home/forestnation/web/staging.forestnation.com/public/wp-includes/plugin.php(517): WP_Hook->do_action()
#35 /home/forestnation/web/staging.forestnation.com/public/wp-admin/includes/plugin.php(705): do_action()
#36 /home/forestnation/web/staging.forestnation.com/public/wp-admin/plugins.php(60): activate_plugin()
#37 {main}
Next Automatic_CSS\ScssPhp\Exception\CompilerException: Incompatible units ex and px.: /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/assets/scss/modules/text/_text-default-styles.scss on line 61, at column 1 Call Stack: #0 import /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/assets/scss/modules/text/_text-default-styles.scss /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/assets/scss/modules/text/_text-vars.scss on line 1 #1 import /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/assets/scss/modules/text/_text-vars.scss /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/assets/scss/automatic-imports.scss on line 25 #2 import /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/assets/scss/automatic-imports.scss (unknown file) on line 1 in /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php:596

Stack trace:

#0 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/CSS_Engine/CSS_File.php(377): Automatic_CSS\ScssPhp\Compiler->compileString() #1 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/CSS_Engine/CSS_File.php(302): Automatic_CSS\CSS_Engine\CSS_File->get_css_from_scss() #2 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/Framework/Base.php(71): Automatic_CSS\CSS_Engine\CSS_File->save_file_from_variables() #3 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/CSS_Engine/CSS_Engine.php(167): Automatic_CSS\Framework\Base->generate_own_css_files() #4 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/CSS_Engine/CSS_Engine.php(146): Automatic_CSS\CSS_Engine\CSS_Engine->generate_all_css_files() #5 /home/forestnation/web/staging.forestnation.com/public/wp-includes/class-wp-hook.php(324): Automatic_CSS\CSS_Engine\CSS_Engine->update_framework_css_files() #6 /home/forestnation/web/staging.forestnation.com/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #7 /home/forestnation/web/staging.forestnation.com/public/wp-includes/plugin.php(517): WP_Hook->do_action() #8 /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/classes/Plugin.php(112): do_action() #9 /home/forestnation/web/staging.forestnation.com/public/wp-includes/class-wp-hook.php(324): Automatic_CSS\Plugin->activate_plugin() #10 /home/forestnation/web/staging.forestnation.com/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #11 /home/forestnation/web/staging.forestnation.com/public/wp-includes/plugin.php(517): WP_Hook->do_action() #12 /home/forestnation/web/staging.forestnation.com/public/wp-admin/includes/plugin.php(705): do_action() #13 /home/forestnation/web/staging.forestnation.com/public/wp-admin/plugins.php(60): activate_plugin() #14 {main} thrown in /home/forestnation/web/staging.forestnation.com/public/wp-content/plugins/automaticcss-plugin/library/ScssPhp/Compiler.php on line 596
global proc radioOptions()
{
	string $win = `window`;
	rowColumnLayout -nc 1;
	string $radioButtons = `radioButtonGrp -l "Select One" -nrb 4 -labelArray4 "One" "2" "C" "fourth" -vr -cw 1 80 -cw 2 200 -sl 1`;
	button -l "Click" -c ("radioResult "+$radioButtons);
	showWindow $win;
}

proc radioResult(string $radioButtons)
{
	int $selection = `radioButtonGrp -q -sl $radioButtons`;

	if ($selection == 2)
	{
		print "it's 2\n";
	}
	else
	{
		print "it's not 2\n";
	}
}
global proc radioDemo()
{
	string $win = `window`;
	rowColumnLayout -nc 1;
	string $radioButtonsName = `radioButtonGrp -nrb 4 -label "LABEL" -la4 "first" "second" "third" "fourth" -vr -sl 3 -cw 1 75`;
	button -label "CLICK HERE" -c ("printSelection "+$radioButtonsName);
	showWindow $win;
}
proc printSelection(string $radioButtonsName)
{
	int $selection = `radioButtonGrp -q -sl $radioButtonsName`;
	print ($selection+"\n");
}
global proc windowUsefulDemo()
{
	string $win = `window -t "Make Colourful Cubes" -wh 600 100`;
	rowColumnLayout -nc 1 -cw 1 600;
	string $amountSlider = `intSliderGrp -l "How Many?" -f 1 -cw 1 80`;
	string $colourSlider = `colorSliderGrp -l "What Colour?" -rgb 0.572002 0.838 0.069554 -cw 1 80`;
	button -l "Create" -c ("createCubes "+$amountSlider+" "+$colourSlider); // send the slider names
	button -l "Close" -c ("deleteUI -wnd "+$win); 
	showWindow $win;
}

proc createCubes(string $amountSlider, string $colourSlider) // makeCubes expects the slider names (as strings)
{
	int $num = `intSliderGrp -q -v $amountSlider`; // query the value from the intSliderGrp
	float $col[] = `colorSliderGrp -q -rgb $colourSlider`; // query the colour from the colorSliderGrp

	string $allCubes[];

	for ($c=0;$c<$num;$c++) // queried int value used here
	{
		string $cubeName[] = `polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1`;
		$allCubes[$c] = $cubeName[0];
	}

	string $mat = `shadingNode -asShader blinn`;
	string $sg = `sets -renderable true -noSurfaceShader true -empty -name ($mat+"SG")`;
	connectAttr -f ($mat+".outColor") ($sg+".surfaceShader");
	setAttr ($mat+".color") -type double3 $col[0] $col[1] $col[2]; // queried colour used here


	select -r $allCubes;
	string $groupName = `group`;
	select -r $groupName;
	sets -e -forceElement $sg;
}
global proc windowDoStuff()
{
	string $win = `window -t "Do Stuff" -wh 600 100`;
	rowColumnLayout -nc 1 -cw 1 600;
	string $intSlide = `intSliderGrp -l "How many?" -f 1`; // get the name of the intSlider
	button -l "Click" -c ("doStuff "+$intSlide); // send the name to the "doStuff" procedure
	showWindow $win;
}

proc doStuff(string $intSlide) // doStuff is expecting the name as an input as a string
{
	polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
	print "HEY GUYS\n";
	print ($intSlide+"\n");
	int $queriedValue = `intSliderGrp -q -v $intSlide`; // get the value from the slider
	print ($queriedValue+"\n");
}
global proc windowDemo()
{
	string $win = `window -t "Demonstration Window" -wh 900 300 -bgc 0.0745215 0.5 0.0575`;
	frameLayout -collapsable 0 -labelVisible 0 ;
		rowColumnLayout -nc 2 -cw 1 450 -cw 2 450 -rs 1 50;
			intSliderGrp -l "First Slider" -f 1 -cw 1 75 -cw 2 50 -min 1 -max 50 -v 25 -fmx 100000;
			floatSliderGrp -label "Second Slider" -f 1;
			checkBoxGrp -label "CLICK?" ;
			colorSliderGrp -label "Colour" -rgb 1 0 0;
			button -l "Create" -bgc 1 0.045 0.669426;
			button -l "Close" -bgc 1 0.461533 0;
		setParent ..;
		rowColumnLayout -nc 1 -cw 1 900;
			floatSliderGrp -label "Wide Slider" -f 1;
			floatSliderGrp -label "Next Wide Slider" -f 1;
	showWindow $win;
}

windowDemo
global proc deformerDemo()
{
	string $cyl[] = `polyCylinder -r 1 -h 100 -sx 20 -sy 50 -sz 1 -ax 0 1 0 -rcp 0 -cuv 3 -ch 1`;
	string $bend[] = `nonLinear -type bend`;
	// Result: bend1 bend1Handle
	expression -s ($bend[0]+".curvature = sin(time*4)*180;")  -o $bend[0] -ae 1 -uc all ;



}
star

Wed Jul 03 2024 13:15:09 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Wed Jul 03 2024 11:52:08 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Wed Jul 03 2024 11:41:42 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Wed Jul 03 2024 11:38:23 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Wed Jul 03 2024 11:35:43 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Wed Jul 03 2024 11:35:22 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Wed Jul 03 2024 11:34:15 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Wed Jul 03 2024 10:06:48 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax

@Sanduni23

star

Wed Jul 03 2024 09:07:46 GMT+0000 (Coordinated Universal Time)

@Ranjith

star

Wed Jul 03 2024 09:02:42 GMT+0000 (Coordinated Universal Time)

@Ranjith

star

Wed Jul 03 2024 09:02:41 GMT+0000 (Coordinated Universal Time)

@Ranjith

star

Wed Jul 03 2024 08:45:48 GMT+0000 (Coordinated Universal Time) https://www.pyramidions.com/mobile-app-development-chennai.html

@Bastina_1 #mobileapp development company

star

Wed Jul 03 2024 08:35:50 GMT+0000 (Coordinated Universal Time) https://codepen.io/JohnTokio/pen/ExzqEBQ?editors

@WebDevSylvester #javascript

star

Wed Jul 03 2024 07:20:45 GMT+0000 (Coordinated Universal Time) https://codepen.io/JohnTokio/pen/ExzqEBQ

@WebDevSylvester #javascript

star

Wed Jul 03 2024 07:04:59 GMT+0000 (Coordinated Universal Time) https://thejsway.net/chapter02/

@WebDevSylvester #javascript

star

Wed Jul 03 2024 02:05:03 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/73561793/create-a-responsive-receipt-cutoff-zig-zag-border

@webmaster30 #css

star

Tue Jul 02 2024 23:35:43 GMT+0000 (Coordinated Universal Time)

@Samuel1347 #flutter #dart #firebase

star

Tue Jul 02 2024 22:36:50 GMT+0000 (Coordinated Universal Time) https://codepen.io/JohnTokio/pen/ExzqEBQ?editors=1111

@WebDevSylvester #javascript

star

Tue Jul 02 2024 22:30:18 GMT+0000 (Coordinated Universal Time) https://codepen.io/JohnTokio/pen/ExzqEBQ?editors=1111

@WebDevSylvester #javascript

star

Tue Jul 02 2024 22:08:58 GMT+0000 (Coordinated Universal Time) https://codepen.io/JohnTokio/pen/ExzqEBQ?editors=1111

@WebDevSylvester #javascript

star

Tue Jul 02 2024 22:07:40 GMT+0000 (Coordinated Universal Time) undefined

@WebDevSylvester

star

Tue Jul 02 2024 21:07:09 GMT+0000 (Coordinated Universal Time)

@chrixsaint

star

Tue Jul 02 2024 17:05:36 GMT+0000 (Coordinated Universal Time)

@nashid

star

Tue Jul 02 2024 16:03:59 GMT+0000 (Coordinated Universal Time) http://localhost:5500/

@tushar1256 #java

star

Tue Jul 02 2024 16:03:38 GMT+0000 (Coordinated Universal Time) http://localhost:5500/

@tushar1256 #java

star

Tue Jul 02 2024 15:49:07 GMT+0000 (Coordinated Universal Time)

@shees

star

Tue Jul 02 2024 12:40:27 GMT+0000 (Coordinated Universal Time)

@zaki

star

Tue Jul 02 2024 12:02:17 GMT+0000 (Coordinated Universal Time)

@mubashir_aziz

star

Tue Jul 02 2024 10:39:22 GMT+0000 (Coordinated Universal Time)

@NoFox420 #javascript

star

Tue Jul 02 2024 10:01:50 GMT+0000 (Coordinated Universal Time) https://justpaste.it/LegShow

@kingtribe201

star

Tue Jul 02 2024 09:58:34 GMT+0000 (Coordinated Universal Time) https://justpaste.it/incest_wanker

@kingtribe201

star

Tue Jul 02 2024 09:57:59 GMT+0000 (Coordinated Universal Time) https://justpaste.it/nursery4fun

@kingtribe201

star

Tue Jul 02 2024 09:46:26 GMT+0000 (Coordinated Universal Time) https://justpaste.it/SexyOutfit

@kingtribe201

star

Tue Jul 02 2024 09:46:19 GMT+0000 (Coordinated Universal Time) https://justpaste.it/SexyOutfit

@kingtribe201

star

Tue Jul 02 2024 09:07:35 GMT+0000 (Coordinated Universal Time)

@Ranjith

star

Tue Jul 02 2024 07:20:02 GMT+0000 (Coordinated Universal Time)

@quanganh141220 #php #single #product

star

Tue Jul 02 2024 06:59:16 GMT+0000 (Coordinated Universal Time)

@niavimi

star

Tue Jul 02 2024 06:53:59 GMT+0000 (Coordinated Universal Time)

@shivam1234

star

Tue Jul 02 2024 04:28:19 GMT+0000 (Coordinated Universal Time)

@davidmchale #events #event #addeventlistener #removelistener

star

Tue Jul 02 2024 03:28:51 GMT+0000 (Coordinated Universal Time)

@davidmchale #dom #scroll #scrollintoview

star

Tue Jul 02 2024 01:27:00 GMT+0000 (Coordinated Universal Time)

@davidmchale #dom #css #inline #getcomputedstyle

star

Tue Jul 02 2024 01:12:22 GMT+0000 (Coordinated Universal Time)

@FOrestNAtion

star

Tue Jul 02 2024 00:50:37 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

star

Tue Jul 02 2024 00:50:05 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

star

Tue Jul 02 2024 00:49:28 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

star

Tue Jul 02 2024 00:48:42 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

star

Tue Jul 02 2024 00:48:00 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

star

Tue Jul 02 2024 00:40:54 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension