Skip to content

Instantly share code, notes, and snippets.

@inerba
inerba / a-horizMouseScroll.js
Last active January 31, 2024 17:26
Horizontal scrolling on a specified element with mouse wheel
/**
* This function enables horizontal scrolling on a specified element when the mouse wheel is used.
* @param {string} selector - The CSS selector of the element on which to enable horizontal scrolling.
* @param {number} scrollValue - The amount to scroll each time the mouse wheel is used. Defaults to 100.
* @param {number} extraScroll - The number of times to allow scrolling past the end of the element. Defaults to 5.
* @returns {void}
*/
export let horizMouseScroll = (
selector,
scrollValue = 100,
@inerba
inerba / backup_database.sh
Last active October 12, 2020 12:35
Scripts di utilità #sviluppo
#!/bin/sh
# Script per il backup del database
# Modificare le variabili seguenti
database=nome_del_db
username=username_db
password=password_db
# Fine modifiche
today=$(date +"%Y-%m-%d-%H-%M-%S")
filename=${database}-${today}.gz
@inerba
inerba / Spread operator.md
Last active April 29, 2020 11:52
[Funzioni] #appunti_php

Spread operator

function spread(...$args){
    return $args;
}

print_r(spread(1,2,3));

//ritorna: Array ( [0] => 1 [1] => 2 [2] => 3 )
@inerba
inerba / Lezione3.md
Last active August 20, 2018 18:46
JavaScript - Lezione 3
@inerba
inerba / gulpfile.js
Created May 2, 2018 20:12
GULP, scss, es6, babel, browserify
var babelify = require('babelify');
var browserSync = require('browser-sync');
var browserify = require('browserify');
var buffer = require('vinyl-buffer');
var gulp = require('gulp');
var plugins = require('gulp-load-plugins');
var source = require('vinyl-source-stream');
/* Configuration */
var config = {
@inerba
inerba / socialshare.md
Last active February 23, 2018 11:51
Social Share script & links

Script

;(function($){
  
  /**
   * jQuery function to prevent default anchor event and take the href * and the title to make a share popup
   *
   * @param  {[object]} e           [Mouse event]
   * @param  {[integer]} intWidth   [Popup width defalut 500]
   * @param  {[integer]} intHeight  [Popup height defalut 400]
@inerba
inerba / formbuilder.md
Last active February 6, 2018 17:15
Eventbuilder #octobercms
@inerba
inerba / deploy con git.md
Last active October 12, 2020 09:07
deploy con git #git

Pubblicazione del sito sul VPS

Directory del sito: /var/www/domain.com
Repository: /var/www/domain.com

Ora vediamo come pubblicare automaticamente sul sito dopo aver fatto push

Creiamo un repository vuoto sul VPS

cd /var
mkdir repo && cd repo