Skip to content

Instantly share code, notes, and snippets.


Andrea Parisi devhero

  • Thux srl
  • Milan
View GitHub Profile
devhero / npm_xcode
Created Apr 10, 2020
gyp: No Xcode or CLT version detected! #install #npm
View npm_xcode
sudo rm -rf $(xcode-select -print-path)
xcode-select --install
/usr/sbin/pkgutil --packages | grep CL
sudo npm install -g node-gyp
devhero / python sqlite3 pyenv macos
Created Jun 26, 2019
View python sqlite3 pyenv macos
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.6.8
devhero / python_build_failed_mojave
Created Jun 5, 2019
python build failed macos mojave #build #python #macos
View python_build_failed_mojave
# BUILD FAILED (OS X 10.14.5 using python-build ...)
# zipimport.ZipImportError: can't decompress data; zlib not available
brew install zlib
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"
export KEEP_BUILD_PATH=true
devhero / virtualbox_access_guest_ip
Created Mar 22, 2019
virtualbox access guest ip
View virtualbox_access_guest_ip
# VirtualBox
# 1. add network adapter
# 2. select: host-only
# 3. select: vboxnet0
# centos
cd /etc/sysconfig/network-scripts/
cp ifcfg-enp0s3 ifcfg-enp0s8
View array_compare.js
array1.length === array2.length && array1.sort().every(function(value, index) { return value === array2.sort()[index]});
devhero /
Created Oct 24, 2018
recursive operation on key
def lower(obj):
return obj.lower()
def lower_dict(obj):
return _recursive_key_op(obj, lower)
def _recursive_key_op(obj, op=None):
if isinstance(obj, dict):
return {op(k): _recursive_key_op(v, op) for k, v in obj.items()}
elif isinstance(obj, (list, set, tuple)):
devhero / flask_tips
Last active Feb 1, 2019
flask tips
View flask_tips
# from
# Setting Command Options
# Click is configured to load default values for command options from environment variables. The variables use the pattern FLASK_COMMAND_OPTION. For example, to set the port for the run command, instead of flask run --port 8000:
export FLASK_RUN_PORT=8000
flask run
* Running on
devhero / jest_webpack_babel
Last active Jun 15, 2018
jest webpack babel
View jest_webpack_babel
npm i -D jest babel-jest transform-es2015-modules-commonjs
// package.json
"jest": {
devhero / babel_unexpected_token
Created May 22, 2018
ERROR in ./index.js Module build failed: SyntaxError: Unexpected token
View babel_unexpected_token
// .babelrc
"presets": [
"plugins": [
devhero / image_conversion_svg_png
Created May 11, 2018
image conversion svg to png
View image_conversion_svg_png
rsvg-convert img.svg > img.png
rsvg-convert -h 256 img.svg > img.png
You can’t perform that action at this time.