cd directory-to-prune
# delete all node_modules in a single rm command
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
# or delete folders one by one printing the folder being deleted
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;| # sudo lsof -i :<PortNumber> | |
| # kill -9 <PID> | |
| # or | |
| # kill -9 $(lsof -ti:<Port>, <Port>) | |
| # The -t flag removes everything but the PID from the lsof output | |
| # Error: listen EADDRINUSE: address already in use ::::3000 | |
| $ lsof -i tcp:3000 | |
| # COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME |
aapt2 d permissions my-app.apk
package: com.google.app
uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'errSecInternalComponent = -2070
An internal component experienced an error
This may occurs when the login keychain is locked, unlocked with:
security unlock-keychain login.keychain
or, Go to Keychain Access and toggle once the lock/unlock icon for Login (keep it unlock)
| #!/bin/bash | |
| echo "Hello World" | |
| # make it executable: chmod +x script.sh or chmod u+x script.sh | |
| # Place it under /usr/local/bin folder.(optional) |
When you type in a form field, a menu may appear, containing past text that you've typed in the field.
To delete a specific piece of saved text, select it in the menu using the arrows on your keyboard, then press Shift+Delete.
| # Generate public/private rsa key pair | |
| ssh-keygen | |
| # Add the key to the ssh-agent | |
| eval `ssh-agent` | |
| ssh-add -K ~/.ssh/id_rsa | |
| # Copy public key content | |
| pbcopy < ~/.ssh/id_rsa.pub |
Go to /System/Library/CoreServices/Applications/
In that folder, you’ll see an app called Screen Sharing,
create a shortcut in your Applications folder (drag & drop with Command+Option)
This App works just like Remote Desktop, and can even save passwords in your system’s Keychain.
Just enter a hostname and remember to enable "Screen Sharing" on the destination machine before starting!
| #!/bin/bash | |
| set -e | |
| # all the available versions at: https://nodejs.org/dist | |
| NODE_VERSION="v8.1.0" | |
| CURRENT_VERSION="" | |
| install_node() { | |
| echo "downloading and installing node $NODE_VERSION, sudo password might be required" | |
| curl "https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.pkg" > "$HOME/Downloads/node-installer.pkg" |
| import Foundation | |
| import React | |
| @objc(MyModule) | |
| class MyModule: RCTEventEmitter { | |
| @objc func loadProducts(_ orderId: NSNumber, resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) { | |
| let products = // load products somehow ... | |
| if products { | |
| resolve(products); |