Skip to content

Instantly share code, notes, and snippets.

View GiuMagnani's full-sized avatar
👨‍💻
Having fun with JavaScript

Giu Magnani GiuMagnani

👨‍💻
Having fun with JavaScript
View GitHub Profile
jQuery(document).ready(function() {
jQuery('a').on('click', function(e) {
smooth_scroll_to(this.hash, e);
});
});
jQuery(window).on('load',function() {
if(window.location.hash) {
smooth_scroll_to(window.location.hash);
}
@GiuMagnani
GiuMagnani / VeeRutValidator.js
Created October 16, 2017 20:45 — forked from eaguad1337/VeeRutValidator.js
Chilean Rut Validator for VeeValidate
// Eduardo Aguad eduaguad@gmail.com
// Use:
// yarn add vee-validate
// import VeeValidate, {Validator} from 'vee-validate';
// Validator.extend('rut', require('./VeeRutValidator'));
// <input type="text" name="rut" v-validate="rut">
module.exports = {
<template>
<other-component v-if="show"></other-component>
</template>
<script>
import OtherComponent from './components/BasicComponent';
export default {
name: 'basic-component',
components: {
@GiuMagnani
GiuMagnani / circles-converted-to-paths.svg
Last active January 20, 2018 00:00
SVG with <circle> tags converted to <path>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GiuMagnani
GiuMagnani / with-circle-tags.svg
Last active January 20, 2018 00:00
SVG with <circle> tags
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GiuMagnani
GiuMagnani / svgo-config.json
Created August 13, 2018 15:14
Config file for SVGO based on config from https://jakearchibald.github.io/svgomg/
{
"plugins": [
{ "removeDoctype": true },
{ "removeXMLProcInst": true },
{ "removeComments": true },
{ "removeMetadata": true },
{ "removeXMLNS": true },
{ "removeEditorsNSData": true },
{ "cleanupAttrs": true },
{ "inlineStyles": true },
@GiuMagnani
GiuMagnani / clann.js
Last active September 11, 2018 12:31
Sorint Clann
const PranzoTimes = [
"12:30:00-13:00:00",
"12:30:00-12:45:00",
"13:00:00-13:30:00"
];
PranzoTimes.map(function(time) {
$('#div-pranzo').append('<button class="my-custom-button-meal">' + time + '</button>');
});
@GiuMagnani
GiuMagnani / SVGtoKeyedObject.js
Last active December 15, 2018 23:35
Node script to take the data from SVG paths ("d", "filename" and "viewBox") and print them as a keyed object for Icon Components.
const testFolder = __dirname + '/svgs';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {
const filePromises = [];
files.forEach((file, index) => {
let concatenatedPath = "";
if (file.indexOf('svg') === -1) return;
@GiuMagnani
GiuMagnani / ZiYoungSelectComponent.vue
Created November 27, 2018 09:25
ZiYoungSelectComponent
<template>
<el-select :value="value" @input="handleInput($event)" filterable placeholder="Select" :filter-method="doFilter"
default-first-option>
<el-option v-for="item in options" :key="item[valueField]" :label="item[labelField]" :value="item[valueField]">
</el-option>
</el-select>
</template>
<script lang="ts">
import Vue from 'vue';
@GiuMagnani
GiuMagnani / ZiYoungSelectComponent2.vue
Created November 27, 2018 10:39
ZiYoungSelectComponent v0.2
<template>
<el-select :value="value" @input="handleInput($event)" filterable placeholder="Select" :filter-method="filterCustomMethod"
default-first-option>
<el-option v-for="(item, index) in filteredOptions" :key="item[valueField]" :label="item[labelField]" :value="item[valueField]">
</el-option>
</el-select>
</template>
<script lang="ts">
import Vue from 'vue';