Skip to content

Instantly share code, notes, and snippets.

View rodrigorrch's full-sized avatar

Renato Rodrigo Chinaglia rodrigorrch

View GitHub Profile
@rap2hpoutre
rap2hpoutre / gup-to-webpack.md
Last active November 22, 2023 00:30
Laravel 5.4: migrate from gulp to webpack
  • Create a webpack.mix.js file in root directory:
const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css');
  
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
generatePagesArray: function(currentPage, collectionLength, rowsPerPage, paginationRange)
{
var pages = [];
var totalPages = Math.ceil(collectionLength / rowsPerPage);
var halfWay = Math.ceil(paginationRange / 2);
var position;
if (currentPage <= halfWay) {
position = 'start';
} else if (totalPages - halfWay < currentPage) {
@Kubo2
Kubo2 / onzoom.js
Last active January 26, 2021 12:44
Detect zoom event in JavaScript
// set zoom event
window.onzoom = function(e) {
// zoom event
}
// detect resize
(function() {
var oldresize = window.onresize;
window.onresize = function(e) {