This file contains 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
<template> | |
<div class="grid grid-cols-1 md:grid-cols-3 gap-2"> | |
<ProjectPreview | |
v-for="project in projects" | |
:key="project.id" | |
:title="project.title" | |
:excerpt="project.excerpt" | |
:feature-image="project.feature_image" | |
/> | |
</div> |
This file contains 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
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
This file contains 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
# Download the legacy format for NGINX compatibility | |
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | |
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | |
# Unzip | |
gunzip Geo*.gz | |
# Copy to /usr/share/GeoIP/ | |
cp Geo*.dat /usr/share/GeoIP/ |
This file contains 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
// Install purgecss as dev dependency | |
$ npm i -D purgecss @fullhuman/postcss-purgecss | |
// First make sure you don't have postcss related stuff in your package.json | |
// Create postcss.config.js file at the root of the project (if not already exist) | |
// Then put in the following code | |
const purgecss = require("@fullhuman/postcss-purgecss") | |
module.exports = { | |
plugins: [ |
This file contains 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
<template> | |
<div> | |
<h1> {{ message }} </h1> | |
<div | |
</template> | |
<script> | |
export default { | |
/* Child component registration */ | |
components: {}, | |
This file contains 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
<div class="card m-2" v-for="pic in location.pictures"> | |
<!-- <img class="m-2" style="height:120px;width:130px" :src="getThumbnailPath(pic)"> --> | |
<img class="m-2" style="height:120px;width:130px" v-secure-image="getThumbnailPath(pic)"> | |
<div class="p-2 d-flex justify-content-center"> | |
<button class="btn btn-sm btn-outline-danger align-self-center" | |
v-if="!complete" | |
@click="removeImage(pic)"> | |
<i class="fa fa-times"></i> Delete | |
</button> | |
</div> |
This file contains 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 Vue from 'vue' | |
function setImgSrc(el, binding) { | |
if (binding.oldValue === undefined || binding.value !== binding.oldValue) { | |
var imageUrl = binding.value; | |
// Enable the code below to use already base64 encoded image response data from server // | |
// axios.get(imageUrl).then(response => el.src = response.data) | |
// Receiving the file from server and base64 encodig the file |
This file contains 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 | |
/** | |
* Set preffered countries for Caldera Forms phone fields | |
*/ | |
add_filter( 'caldera_forms_phone_js_options', function( $options){ | |
//Use ISO_3166-1_alpha-2 formatted country code | |
$options[ 'preferredCountries' ] = array( 'MX' ); | |
return $options; | |
}); |
This file contains 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
axios({ | |
url: 'http://my-api.dev/file-download', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); //or any other extension | |
document.body.appendChild(link); |
This file contains 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
<template> | |
<b-container fluid> | |
<app-nav/> | |
<nuxt/> | |
</b-container> | |
</template> | |
<script> | |
export default { | |
mounted() { |