Skip to content

Instantly share code, notes, and snippets.

View phucnguyen81's full-sized avatar
🏠
Working from home

Phuc Nguyen phucnguyen81

🏠
Working from home
  • KMS
  • Vietnam
View GitHub Profile
@phucnguyen81
phucnguyen81 / python_environment_setup.md
Created January 3, 2022 12:28 — forked from wronk/python_environment_setup.md
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview of Python Virtual Environments

This guide is targetted at intermediate or expert users who want low-level control over their Python environments.

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.


h/t @sharkinsspatial for linking me to the perfect cartoon

@phucnguyen81
phucnguyen81 / slim-redux.js
Created July 11, 2018 13:24 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@phucnguyen81
phucnguyen81 / git_cheat-sheet.md
Last active July 3, 2018 03:27 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet
@phucnguyen81
phucnguyen81 / .eslintrc.js
Created July 1, 2018 04:10 — forked from adrianhall/.eslintrc.js
A sample .eslintrc file
var OFF = 0, WARN = 1, ERROR = 2;
module.exports = exports = {
"env": {
"es6": true
},
"ecmaFeatures": {
// env=es6 doesn't include modules, which we are using
"modules": true
@phucnguyen81
phucnguyen81 / set_bash_prompt.sh
Last active June 21, 2018 15:46 — forked from ckabalan/best_bash_prompt.sh
Bash prompt showing git/python/command-count info
# Bash History Replacement Script
# Author: Caesar Kabalan
# Last Modified: June 6th, 2017
# Description:
# Modifies the default Bash Shell prompt tot be in the format of:
# [CWD:COUNT:BRANCH:VENV]
# [USER:HOSTNAME] _
# Where:
# CWD - Current working directory (green if last command returned 0, red otherwise)
# COUNT - Session command count