This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
const ProductSchema = new Schema({ | |
name: { type: String, required: 'Name is required' }, | |
sale_price: { type: Number, required: 'Sale price is required' }, | |
cost_price: { type: Number, required: 'Cost price is required '}, | |
quantity: { type: Number, default: 0 } | |
}, { | |
timestamps: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/php:7.3-apache-node-browsers | |
working_directory: ~/ci_deploy | |
steps: | |
- checkout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | |
use \Firebase\JWT\JWT; | |
Class Test extends CI_Controller | |
{ | |
public function index() | |
{ | |
$key = "example_key"; | |
$token = array( | |
"iss" => "http://example.org", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "product_manager_api", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "node index.js", | |
"dev": "nodemon index.js" | |
}, | |
"keywords": [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const mongoose = require('mongoose'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
const PORT = process.env.PORT || 3000; | |
const productCtrl = require('./product_controller'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Product = require('./product_model'); | |
module.exports = { | |
getProducts: async (req, res, next) => { | |
Product.find({}).exec((error, result) => { | |
if (error) { | |
return next(error); | |
} | |
if (result) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
const ProductSchema = new Schema({ | |
name: { type: String, required: true }, | |
qty: { type: Number }, | |
cost_price: { type: Number }, | |
sale_price: { type: Number } | |
}, { | |
timestamps: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
'$match': { | |
'createdAt': { | |
'$gte': new Date('Fri, 01 Nov 2019 00:00:00 GMT'), | |
'$lte': new Date('Sun, 01 Dec 2019 00:00:00 GMT') | |
} | |
} | |
}, { | |
'$group': { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Create() | |
'Updateby Extendoffice 20160704 | |
Dim I As Long | |
Dim xNumber As Integer | |
Dim xName As String | |
Dim xActiveSheet As Worksheet | |
On Error Resume Next | |
Application.ScreenUpdating = False | |
Set xActiveSheet = ActiveSheet | |
xNumber = InputBox("Enter number of times to copy the current sheet") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.GestureDetector; | |
import android.view.MotionEvent; | |
import android.view.View; | |
public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener { | |
private OnItemClickListener mListener; | |
public interface OnItemClickListener { |