This file contains 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
JavaScript ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 9 hrs 18 mins | |
Mustache ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3 hrs 33 mins | |
TypeScript ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2 hrs 43 mins | |
Other ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 13 mins | |
Git Config ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0 secs |
This file contains 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
1. ```ls -a -lh -t --color=always``` | |
2. ###macro.sh: | |
``` | |
!/bin/bash | |
cwd=$(pwd); | |
``` | |
###polo.sh: | |
``` | |
!/bin/bash | |
cd $cwd; |
This file contains 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
#.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 |
This file contains 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 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 => { |
This file contains 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
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++) { |
This file contains 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"); | |
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"); |
This file contains 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 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" }); | |
}; |