Skip to content

Instantly share code, notes, and snippets.

View rupinder-developer's full-sized avatar
😬
I may be slow to respond.

Rupinder Singh rupinder-developer

😬
I may be slow to respond.
View GitHub Profile

venv

The module used to create and manage virtual environments is called venv. venv will usually install the most recent version of Python that you have available. If you have multiple versions of Python on your system, you can select a specific Python version by running python3 or whichever version you want.

To create a virtual environment, decide upon a directory where you want to place it, and run the venv module as a script with the directory path:

python3 -m venv tutorial-env

This will create the tutorial-env directory if it doesn’t exist, and also create directories inside it containing a copy of the Python interpreter and various supporting files.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rupinder-developer
rupinder-developer / world.geojson
Created June 25, 2021 08:43
GeoJSON data of World Map for D3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rupinder-developer
rupinder-developer / mac-setup-redis.md
Created November 10, 2020 08:52 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
<?php
/**
* Get Header Authorization
*/
function getAuthorizationHeader(){
$headers = null;
if (isset($_SERVER['Authorization'])) {
$headers = trim($_SERVER["Authorization"]);
}
else if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
/*
Here's all you have to do to add clustering to your node.js application.
- save this code as `cluster.js`, and run `cluster.js` instead of `server.js`
- the only line you'll need to change is the last line - it needs to point to the location of your `server.js` file
*/
var cluster = require('cluster');
if (cluster.isMaster) {
// Count the machine's CPUs