Skip to content

Instantly share code, notes, and snippets.

View BindiChen's full-sized avatar

Bindi Chen BindiChen

View GitHub Profile
@BindiChen
BindiChen / list-of-encoding.py
Created February 20, 2020 20:57
Create a list of all known face encodings
n = 100 # Suppose there is 100 known people
known_face_encodings = []
for num in range(1, n + 1):
image_file = f"known_person_{num}.jpg"
# Load each known image
image_of_person = face_recognition.load_image_file(image_file)
# Get the face encoding of each person. This can fail if no one is found in the photo
face_encoding = face_recognition.face_encodings(image_of_person)[0]
# Create a list of all known face encodings
known_face_encodings.append(face_encoding)
@BindiChen
BindiChen / npm-ls-symlink.sh
Created February 20, 2020 17:17
To see all globally available npm link dependencies (symlink)
@BindiChen
BindiChen / npm-ls-app.sh
Created February 20, 2020 17:10
List app's dependencies
⇒ npm ls --depth 0
[email protected] /Users/admin/Code/WorkSpace/react-app-es6-jest
├── @babel/[email protected]
├── @babel/[email protected]
├── @babel/[email protected]
├── @babel/[email protected]
├── @babel/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
@BindiChen
BindiChen / npm-list-g.sh
Created February 20, 2020 17:07
npm list global dependencies
⇒ npm ls -g --depth 0
/Users/admin/.nvm/versions/node/v10.16.3/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
@BindiChen
BindiChen / npm-outdated.sh
Created February 20, 2020 17:01
Check for outdated dependencies
⇒ npm outdated
Package Current Wanted Latest Location
@babel/cli 7.7.4 7.8.4 7.8.4 react-app-es6-jest
@babel/core 7.7.4 7.8.4 7.8.4 react-app-es6-jest
@babel/node 7.7.4 7.8.4 7.8.4 react-app-es6-jest
@babel/preset-env 7.7.4 7.8.4 7.8.4 react-app-es6-jest
@babel/preset-react 7.7.4 7.8.3 7.8.3 react-app-es6-jest
concurrently 5.0.0 5.1.0 5.1.0 react-app-es6-jest
core-js 3.4.2 3.6.4 3.6.4 react-app-es6-jest
css-loader 3.2.1 3.4.2 3.4.2 react-app-es6-jest
⇒ npm run
Lifecycle scripts included in react-app-es6-jest:
prestart
npm run build:configuration
start
concurrently "npm run start:server" "npm run start:client"
test
echo "Error: no test specified" && exit 1
available via `npm run-script`:
@BindiChen
BindiChen / npm-vew.sh
Last active February 20, 2020 16:52
npm view to see a package registry info
⇒ npm view express
[email protected] | MIT | deps: 30 | versions: 263
Fast, unopinionated, minimalist web framework
http://expressjs.com/
keywords: express, framework, sinatra, web, rest, restful, router, app, api
dist
.tarball: https://artifactory.corp.mendeley.com:443/artifactory/api/npm/node-all/express/-/express-4.17.1.tgz
@BindiChen
BindiChen / npm-ls.sh
Last active February 20, 2020 16:47
npm list to get the path to the specified package
⇒ gulp clean && gulp build
fs.js:27
const { Math, Object } = primordials;
^
ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (/Users/admin/Code/my-app/node_modules/natives/index.js:143:24)
at Object.req [as require] (/Users/admin/Code/my-app/node_modules/natives/index.js:55:10)
at Object.<anonymous> (/Users/admin/Code/my-app/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:955:30)
@BindiChen
BindiChen / webpack.config.js
Last active February 5, 2017 00:59
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : false,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"