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
| <?php | |
| /** | |
| * simple method to encrypt or decrypt a plain text string | |
| * initialization vector(IV) has to be the same when encrypting and decrypting | |
| * | |
| * @param string $action: can be 'encrypt' or 'decrypt' | |
| * @param string $string: string to encrypt or decrypt | |
| * | |
| * @return string | |
| */ |
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
| var crypto = require('crypto') | |
| , key = 'your secret key here' | |
| , plaintext = 'Text to be encrypted' | |
| , cipher = crypto.createCipher('aes-256-cbc', key) | |
| , decipher = crypto.createDecipher('aes-256-cbc', key); | |
| var encryptedPassword = cipher.update(plaintext, 'utf8', 'base64'); | |
| encryptedPassword += cipher.final('base64') | |
| var decryptedPassword = decipher.update(encryptedPassword, 'base64', 'utf8'); |
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
| 1. Install bootstrap as a dev dependency, and its dependencies (node-sass and sass-loader) | |
| `npm install --save-dev bootstrap@4.0.0-beta.2 node-sass sass-loader` | |
| 2. Install nuxt plugin of bootstrap vue (includes bootstrap-vue as a dependency) | |
| `npm install @nuxtjs/bootstrap-vue` | |
| 3. Register plugin as module in nuxt.config.js (see below) | |
| 4. Create app.scss entry point (see below) |
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
| # Pass the env-vars to MYCOMMAND | |
| eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
| # … or ... | |
| # Export the vars in .env into your shell: | |
| export $(egrep -v '^#' .env | xargs) |
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
| @function strip-unit($value) | |
| @return $value / ($value * 0 + 1); | |
| } | |
| @mixin fluid-type($min-vw, $max-vw, $min-font-size, $max-font-size) { | |
| $u1: unit($min-vw); | |
| $u2: unit($max-vw); | |
| $u3: unit($min-font-size); | |
| $u4: unit($max-font-size); | |
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
| @tailwind base; | |
| @tailwind components; | |
| @tailwind utilities; |
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
| module.exports = () => ({ | |
| plugins: [require("tailwindcss")], | |
| }) |
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
| module.exports = { | |
| ... | |
| plugins: [ | |
| `gatsby-plugin-postcss`, | |
| `gatsby-plugin-react-helmet`, | |
| ... | |
| ], | |
| } |
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 | |
| # | |
| # steps taken verbatim from: | |
| # http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html#install_docker | |
| # | |
| sudo yum update -y | |
| sudo yum install -y docker | |
| sudo service docker start | |
| sudo usermod -a -G docker ec2-user | |
| # log out and log in to pickup the added group |
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
| // vanilla JS window width and height | |
| var w=window, | |
| d=document, | |
| e=d.documentElement, | |
| g=d.getElementsByTagName('body')[0], | |
| x=w.innerWidth||e.clientWidth||g.clientWidth, | |
| y=w.innerHeight||e.clientHeight||g.clientHeight; |