This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect } from 'react'; | |
| const importScript = resourceUrl=> { | |
| useEffect(() => { | |
| const script = document.createElement('script'); | |
| script.src = resourceUrl; | |
| script.async = true; | |
| document.body.appendChild(script); | |
| return () => { | |
| document.body.removeChild(script); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Assumes the database container is named 'db' | |
| DOCKER_DB_NAME="$(docker-compose ps -q db)" | |
| DB_HOSTNAME=db | |
| DB_USER=postgres | |
| LOCAL_DUMP_PATH="path/to/local.dump" | |
| docker-compose up -d db | |
| docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}" | |
| docker-compose stop db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ xcode-select --install | |
| $ brew install openssl | |
| $ virtualenv env | |
| $ . env/bin/activate | |
| $(env) env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //For example, to override the AppBar (https://material-ui-next.com/api/app-bar/) root class we can do the following: | |
| // First method (override Material UI classnames): | |
| // 1 - Add the property classes in the AppBar component: | |
| <AppBar classes={{root: 'my-root-class'}} | |
| // 2 - Override the styles with the styled components: | |
| styled(AppBar)` | |
| &.my-root-class { | |
| z-index: 1500; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ADB_PATH="/Users/${USER}/Library/Android/sdk/platform-tools" | |
| PACKAGE_NAME="com.yourcompany.app" | |
| DB_NAME="default.realm" | |
| DESTINATION_PATH="/Users/${USER}/Downloads/${DB_NAME}" | |
| NOT_PRESENT="List of devices attached" | |
| ADB_FOUND=`${ADB_PATH}/adb devices | tail -2 | head -1 | cut -f 1 | sed 's/ *$//g'` | |
| if [[ ${ADB_FOUND} == ${NOT_PRESENT} ]]; then | |
| echo "Make sure a device is connected" | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| VERSION=4.0.1 | |
| SCRIPT=`basename "$0"` | |
| APPNAME="My App" | |
| APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns" | |
| OSX_VERSION=`sw_vers -productVersion` | |
| PWD=`pwd` | |
| function usage { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windows Registry Editor Version 5.00 | |
| [-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder] | |
| [-HKEY_CLASSES_ROOT\Directory\shell\Cmder] |