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
| ^((?!substring).)*$ |
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 has been truncated, but you can view the full file.
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
| ft outer join webflix.acteur acteur2_ on this_.acteurid=acteur2_.acteurid inner join webflix.film film3_ on this_.filmid=film3_.filmid left outer join webflix.realisateur realisateu4_ on film3_.realisateurid=realisateu4_.realisateurid where this_.personnageid in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) | |
| 2018-10-23 19:06:30.770 DEBUG 80870 --- [ entityloader-1] org.hibernate.SQL : select this_.personnageid as personnageid1_13_3_, this_.acteurid as acteurid3_13_3_, this_.filmid as filmid4_13_3_, this_.nom as nom2_13_3_, acteur2_.acteurid as acteurid1_0_0_, acteur2_.biographie as biographie2_0_0_, acteur2_.datenaissance as datenaissance3_0_0_, acteur2_.lieunaissance as lieunaissance4_0_0_, acteur2_.nom as nom5_0_0_, acteur2_.prenom as prenom6_0_0_, film3_.filmid as filmid1_5_1_, film3_.anneessortie as anneessortie2_5_1_, film3_.langueoriginale as langueoriginale3_5_1_, film3_.nbcopie as nbcopie4_5_1_, film3_.realisateurid as realisateurid7_5_1_, film3_.resumescenario as resumescenario5_5_1_, film3_.t |
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
| First you need to add the file (stage) then | |
| git update-index --chmod=+x file_name |
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
| { | |
| "Use Non-ASCII Font" : false, | |
| "Tags" : [ | |
| ], | |
| "Ansi 12 Color" : { | |
| "Green Component" : 0.3333333432674408, | |
| "Red Component" : 0.3333333432674408, | |
| "Blue Component" : 1 | |
| }, |
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
| 048b67174c7dcfe2da7a570f9929f7194c450a58a67ff0360be2a0520b95cd743b749a99f6227eb5ee3647818125e6ebdcd480d9edabbc17b63420f613937ee171 |
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
| const user = {name: 'Shivek Khurana', age: 23, password: 'SantaCl@use'}; | |
| const userWithoutPassword = Object.keys(user) | |
| .filter(key => key !== 'password') | |
| .map(key => ({[key]: user[key]})) | |
| .reduce((accumulator, current) => | |
| ({...accumulator, ...current}), | |
| {} | |
| ) | |
| ; | |
| // userWithoutPassword becomes {name: 'Shivek Khurana', age: 23} |
NewerOlder