Skip to content

Instantly share code, notes, and snippets.

Jorge Epuñan juanbrujo

Block or report user

Report or block juanbrujo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@juanbrujo
juanbrujo / fullCalendarDisablePrevNext.js
Last active Jan 26, 2020
jQuery FullCalendar.js: disable prev/next button for past/future dates
View fullCalendarDisablePrevNext.js
$('#calendar').fullCalendar({
viewRender: function(currentView){
var minDate = moment(),
maxDate = moment().add(2,'weeks');
// Past
if (minDate >= currentView.start && minDate <= currentView.end) {
$(".fc-prev-button").prop('disabled', true);
$(".fc-prev-button").addClass('fc-state-disabled');
}
else {
@juanbrujo
juanbrujo / comunas-regiones.json
Last active Jan 26, 2020 — forked from sergiohidalgo/comunas-regiones-chile.json
Comunas y regiones de chile JSON
View comunas-regiones.json
{
"regiones": [{
"region": "Arica y Parinacota",
"comunas": ["Arica", "Camarones", "Putre", "General Lagos"]
},
{
"region": "Tarapacá",
"comunas": ["Iquique", "Alto Hospicio", "Pozo Almonte", "Camiña", "Colchane", "Huara", "Pica"]
},
{
@juanbrujo
juanbrujo / sharebuttons.html
Last active Jan 21, 2020
lightweight share buttons with vanilla javascript
View sharebuttons.html
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" class="share facebook">Facebook</a>
<a href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php the_title(); ?>&via=twitter" class="share twitter">Twitter</a>
<a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" class="share google">Google+</a>
<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&source=LinkedIn.com&title=<?php the_title(); ?>" class="share linkedin">LinkedIn</a>
@juanbrujo
juanbrujo / getLastRSSFeed.html
Last active Nov 11, 2019
Get and display last feed from RSS using JavaScript (jQuery)
View getLastRSSFeed.html
<html>
<head></head>
<body>
<div class="noticia">CARGANDO</div>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script>
$(function(){
var url = 'https://www.domain.co/index.xml';
var news = $('.noticia');
@juanbrujo
juanbrujo / multipleEventsListeners.js
Last active Nov 5, 2019
Add the capability to attach multiple events to an element, just like jQuery does
View multipleEventsListeners.js
/**
* multipleEventsListeners.js
* Add the capability to attach multiple events to an element, just like jQuery does
* https://gist.github.com/juanbrujo/a1f77db1e6f7cb17b42b
*/
function multipleEventsListeners(elem, events, func) {
var event = events.split(' ');
for (var i = 0; i < event.length; i++) {
elem.addEventListener(event[i], func, false);
@juanbrujo
juanbrujo / less-mediaqueries-mixin.less
Last active Oct 19, 2019
LESS mediaqueries mixin
View less-mediaqueries-mixin.less
// Declare your mediaqueries breakpoints
@mobile: ~"only screen and (max-width: 529px)";
@tablet: ~"only screen and (min-width: 530px) and (max-width: 949px)";
@desktop: ~"only screen and (min-width: 950px) and (max-width: 1128px)";
@desktop-xl: ~"only screen and (min-width: 1129px)";
// Use them easily in your CSS declaration:
element {
property: value;
@juanbrujo
juanbrujo / Mati.vue
Created Oct 15, 2019
How to use Mati (getmati.com) Web SDK in a VueJS project
View Mati.vue
<template>
<div>
<div v-html="MatiButton('CLIENTID')"></div>
</div>
</template>
<script>
@juanbrujo
juanbrujo / npm-starter.js
Last active Oct 15, 2019
Starter for a basic NPM module
View npm-starter.js
// moduleName = name of your npm module
var moduleName = (function moduleName() {
"use strict";
// YOUR PRETTY JS CODE THAT WILL CHANGE THE WORLD
// return whatever;
})( this );
View CheckEmptyObject.js
const obj = {}
Object.keys(obj).length === 0 && obj.constructor === Object
@juanbrujo
juanbrujo / checkEmail.vue
Created Aug 29, 2019
Regex to check if email is valid for a Vue.js method.
View checkEmail.vue
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
}
You can’t perform that action at this time.