Skip to content

Instantly share code, notes, and snippets.

View ddhira123's full-sized avatar

Dhana D. ddhira123

  • IPB University
View GitHub Profile
const tf = require('@tensorflow/tfjs-node');
const image = require('get-image-data');
const fs = require('fs');
var path = require('path');
const classes = ['rock', 'paper', 'scissors'];
exports.makePredictions = async (req, res, next) => {
const imagePath = `./public/images/${req && req['filename']}`;
try {
// More Explanations on
//
const express = require('express');
const multer = require('multer');
const controller = require('../controllers/PredictController');
const filename = `test-image-${Date.now().toString()}.jpg`;
// configure multer
const storage = multer.diskStorage({
@ddhira123
ddhira123 / app.js
Created February 8, 2022 07:03
Initial AppJs with Express+PUG
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var app = express();
@ddhira123
ddhira123 / Proxy Config for IntellijIDEA.md
Created January 31, 2022 07:12
If you are working with Intellij behind network proxy in Windows and you wish to make it align with your system proxy, do this.

If you use IntellijIDEA that was installed from Jetbrains Toolbox:

  1. Look for the idea.properties in the directory:
    %AppData%\Roaming\JetBrains\IntelliJIdea2021.3
    
  2. Add this line in that file:
    java.net.useSystemProxies=true
    

Open cmd/terminal and run these commands along with your own proxy host and port.

npm config set proxy http://[YOUR PROXY HOST]:[PORT]

npm config set https-proxy http://[YOUR PROXY HOST]:[PORT]

npm config set http-proxy http://[YOUR PROXY HOST]:[PORT]

@ddhira123
ddhira123 / Proxy Config for Visual Studio.md
Created January 31, 2022 07:04
When you are behind network (corporate) proxy and you wish to install with Visual Studio Installer, This config may help you.

In the machine.config file under these 2 folders:

  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config

Add this configuration in the bottom (before the last closing tag):

<system.net>
  
@ddhira123
ddhira123 / Serverless Cloud Run Development: Challenge Lab
Created January 29, 2022 10:37
Solution for Serverless Cloud Run Development: Challenge Lab. Change the ones next to `(change this with yours)`
============TASK 1==========================
T1PUBLICBILL=public-billing-service-593 (change this with yours)
cd
cd ~/pet-theory/lab07/unit-api-billing
gcloud builds submit --tag gcr.io/$PROJECT_ID/billing-staging-api:0.1
gcloud run deploy $T1PUBLICBILL --image gcr.io/$PROJECT_ID/billing-staging-api:0.1
gcloud run services list
@ddhira123
ddhira123 / cmd.sh
Created December 2, 2019 13:26
one of most interesting and important command in bash linux, Directory traversal.
#!bin/sh
ls -lah
{
"cmd": ["g++.exe", "${file}", "-o", "${file_base_name}.exe", "&&" , "${file_base_name}.exe<inputf.in>outputf.in"],
"shell":true,
"working_dir":"$file_path",
"selector":"source.cpp"
}