Skip to content

Instantly share code, notes, and snippets.

View juanbrujo's full-sized avatar
:octocat:

Jorge Epuñan juanbrujo

:octocat:
View GitHub Profile
@juanbrujo
juanbrujo / InstallIPTVoverPlexMediaServer.md
Last active March 28, 2024 06:45
Install IPTV channels list over Plex Media Server
@juanbrujo
juanbrujo / fetchRemoteBranches2Local
Last active November 4, 2020 14:10
Fetch all remote branches to local
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
# https://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches
@juanbrujo
juanbrujo / netlify.toml
Created September 28, 2020 14:06
Netlify configuration for routes in a SPA
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
@juanbrujo
juanbrujo / select.html
Last active August 19, 2020 21:50
HTML native select attribute that holds the dropdown with scroll if needed by viewport
<!-- test: https://jsbin.com/renixijogu/1/edit?html,css,output -->
<select size="number">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
@juanbrujo
juanbrujo / Mati.vue
Created October 15, 2019 14:49
How to use Mati (getmati.com) Web SDK in a VueJS project
<template>
<div>
<div v-html="MatiButton('CLIENTID')"></div>
</div>
</template>
<script>
const obj = {}
Object.keys(obj).length === 0 && obj.constructor === Object
@juanbrujo
juanbrujo / checkEmail.vue
Created August 29, 2019 15:21
Regex to check if email is valid for a Vue.js method.
checkEmail: function (email) {
// eslint-disable-next-line
const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
if (reg.test(email)) return false
return true
}
@juanbrujo
juanbrujo / custom-error-on-specific-route.js
Created August 7, 2019 16:03
json-server: Custom error (400, 500) when targeting specific route
const jsonServer = require('json-server')
const server = jsonServer.create()
const router = jsonServer.router('mock/db.json')
const middlewares = jsonServer.defaults()
const port = process.env.PORT || 3000
server.use(middlewares)
// send error message when validating code on invest
server.get('/invest_url', (req, res) => {
@juanbrujo
juanbrujo / form-netlify.css
Last active September 4, 2022 19:39
JS function to send by AJAX a form data to Netlify Forms
.result {
display: none;
}
.active {
display: block;
}
.inactive {
display: none;
@juanbrujo
juanbrujo / hidden-safari.css
Created December 5, 2018 19:03
CSS hack targeting Safari Desktop & Mobile
/**
** test: https://jsbin.com/gacizoyota/1/edit?html,css,output
*/
@media not all and (min-resolution:.001dpcm) {
@media {
/* your code */
}
}