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 |
View python sqlite3 pyenv macos
# https://github.com/pyenv/pyenv/issues/108 | |
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.6.8 |
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 |
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]}); |
View recursive_op_key.py
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)): |
View flask_tips
# from http://flask.pocoo.org/docs/1.0/cli/ | |
# 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 http://127.0.0.1:8000/ |
View jest_webpack_babel
// https://redux.js.org/recipes/writing-tests | |
// https://facebook.github.io/jest/docs/en/webpack.html | |
npm i -D jest babel-jest transform-es2015-modules-commonjs | |
// package.json | |
{ | |
... | |
"jest": { |
View babel_unexpected_token
// https://stackoverflow.com/questions/34614812/error-in-index-js-module-build-failed-syntaxerror-unexpected-token#34619867 | |
// .babelrc | |
{ | |
"presets": [ | |
"react", | |
"env" | |
], | |
"plugins": [ |
View image_conversion_svg_png
rsvg-convert img.svg > img.png | |
rsvg-convert -h 256 img.svg > img.png |
NewerOlder