Skip to content

Instantly share code, notes, and snippets.

View MuhammadHasham23's full-sized avatar
🎯
Focusing

Muhammad Hasham MuhammadHasham23

🎯
Focusing
View GitHub Profile
import axios from "axios";
export const addTodo = item => async dispatch => {
const res = await axios.post("http://localhost:5000/addTodo", item);
dispatch({ type: "ADD_TODO", payload: "res" });
};
const express = require("express");
const mongoose = require("mongoose");
var session = require("express-session");
const passport = require("passport");
const bodyParser = require("body-parser");
require("./models/User");
require("./services/passport.js");
const basicRoutes = require("./routes/basicRoutes");
const authRoutes = require("./routes/authRoutes");
const keys = require("./keys/keys");
function spiralMatrix(total) {
var noOfRows = 0;
var noOfCols = 0;
var numbers = [];
for (let i = 0; i < Math.pow(total, 2); i++) {
numbers[i] = i + 1;
}
var numberIter = 0;
var newarr = [];
for (let i = 0; i < total; i++) {
const cluster = require ('cluster');
const os = require ('os');
if (cluster.isMaster) {
const cpus = os.cpus ().length;
console.log (`Forking for ${cpus} CPUs`);
for (let i = 0; i < cpus; i++) {
cluster.fork ();
}
Object.values (cluster.workers).forEach (worker => {
#.htaccess for sub directories react
Options FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
1. ```ls -a -lh -t --color=always```
2. ###macro.sh:
```
!/bin/bash
cwd=$(pwd);
```
###polo.sh:
```
!/bin/bash
cd $cwd;
@MuhammadHasham23
MuhammadHasham23 / weekly_dev_breakdown.js
Last active November 30, 2020 14:57
weekly_dev_breakdown
JavaScript ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 9 hrs 18 mins
Mustache ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3 hrs 33 mins
TypeScript ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2 hrs 43 mins
Other ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 13 mins
Git Config ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0 secs