This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
Important: your node location may vary. Use which node to find it, or use it directly in the command:
| # script used to publish package to npm and push new tag | |
| # step 1 - change version from package json | |
| # step 2 - run ./scripts/publish-npm.sh $version i.e ./scripts/publish-npm.sh 0.0.3 | |
| set -e | |
| if [ $# -eq 0 ] | |
| then | |
| echo "Please specify version." | |
| exit | |
| fi |
| mogrify -set comment 'Extraneous bytes removed' *.jpg |
| from keras.datasets import mnist | |
| import cv2 | |
| import os | |
| from tqdm import tqdm | |
| from config import * | |
| (x_train, y_train), (x_test, y_test) = mnist.load_data() | |
| def extract(x,y,dir_path): |
| import { print, isSpecifiedScalarType, isSpecifiedDirective } from 'graphql'; | |
| export function printSchemaWithDirectives(schema) { | |
| const str = Object | |
| .keys(schema.getTypeMap()) | |
| .filter(k => !k.match(/^__/)) | |
| .reduce((accum, name) => { | |
| const type = schema.getType(name); | |
| return !isSpecifiedScalarType(type) | |
| ? accum += `${print(type.astNode)}\n` |
| #### KERAS #### | |
| import tensorflow as tf | |
| from keras.backend.tensorflow_backend import set_session | |
| config = tf.ConfigProto() | |
| config.gpu_options.per_process_gpu_memory_fraction = 0.3 | |
| set_session(tf.Session(config=config)) | |
| #### TF #### | |
| config = tf.ConfigProto( | |
| gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.5), |
| from __future__ import print_function | |
| from keras.preprocessing import sequence | |
| from keras.models import Sequential | |
| from keras.layers import Dense, Embedding | |
| from keras.layers import LSTM | |
| from keras.datasets import imdb | |
| max_features = 20000 | |
| maxlen = 80 # cut texts after this number of words (among top max_features most common words) |
| # -*- coding: utf-8 -*- | |
| """ResNet50 model for Keras with fused intermediate layers | |
| # Reference: | |
| https://arxiv.org/pdf/1604.00133.pdf | |
| Adapted from original resnet | |
| """ | |
| from __future__ import print_function | |
| from __future__ import absolute_import | |
| import warnings |
| from keras import backend as K | |
| cfg = K.tf.ConfigProto() | |
| cfg.gpu_options.allow_growth = True | |
| K.set_session(K.tf.Session(config=cfg)) | |
| K.clear_session() |