Skip to content

Instantly share code, notes, and snippets.

View willi-dev's full-sized avatar

willi-dev willi-dev

View GitHub Profile
@willi-dev
willi-dev / openssl_encrypt_decrypt.php
Created September 2, 2019 07:25 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?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
*/
@willi-dev
willi-dev / encrypt-decrypt.js
Created August 30, 2019 09:46
Encryption and decryption with AES-256-cbc in node.js
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');
@willi-dev
willi-dev / _Instructions
Created August 9, 2019 01:27 — forked from benmccallum/_Instructions.md
nuxtjs, vue-bootstrap with custom bootstrap build
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)
@willi-dev
willi-dev / parse_dotenv.bash
Created July 23, 2019 14:54 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# 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)
@willi-dev
willi-dev / fluid-font-mixin.scss
Created July 1, 2019 04:32
SASS mixin for responsive fluid font size.
@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);
@willi-dev
willi-dev / app.css
Created June 28, 2019 15:34
app.css for gatsby js style with tailwind css
@tailwind base;
@tailwind components;
@tailwind utilities;
@willi-dev
willi-dev / postcss.config.js
Created June 28, 2019 14:53
postcss.config.js in tailwind css
module.exports = () => ({
plugins: [require("tailwindcss")],
})
@willi-dev
willi-dev / gatsby.config.js
Created June 28, 2019 14:52
config gatsby js with postcss
module.exports = {
...
plugins: [
`gatsby-plugin-postcss`,
`gatsby-plugin-react-helmet`,
...
],
}
@willi-dev
willi-dev / install-docker.sh
Created May 21, 2019 01:21 — forked from brianz/install-docker.sh
Install docker on Amazon Linux
#!/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
@willi-dev
willi-dev / window-height-width.js
Created March 22, 2019 02:27 — forked from joshcarr/window-height-width.js
vanilla JS window width and height
// 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;