Skip to content

Instantly share code, notes, and snippets.

View fatrex's full-sized avatar
🖖
Live long and code 👨🏼‍💻

Daniele Lenares fatrex

🖖
Live long and code 👨🏼‍💻
View GitHub Profile
@fatrex
fatrex / backup-script.sh
Last active January 19, 2025 09:59
dietpi-backup compress & move
#!/bin/bash
# Backups default directory
BACKUP_DIR="/mnt/dietpi-backup"
# Backups destination folder
DESTINATION_DIR="/dest-folder-for-archive"
# Current human readble timestamo
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
var slug = title.trim().toLowerCase();
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var index in from ) {
slug = slug.replace(new RegExp(from.charAt(index), 'g'), to.charAt(index));
}
slug = slug.replace( /[^a-z0-9 -]/g, '' )
.replace( /\s+/g, '-' )
.replace( /-+/g, '-' );
Simple Vagrant configuration with only node
@fatrex
fatrex / vagrant-rails2-ruby2-postgres
Last active September 29, 2024 21:05
Vagrant Rails4 + Ruby2 + Postgres
Vagrant file and Chef file for creating a virtual machine with Ruby 2.2.2, Rails 4 and Postgres
@fatrex
fatrex / gulpfile.js
Last active February 25, 2017 10:56
Gulp for Symfony 2
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var shell = require('gulp-shell');
gulp.task('serve', ['dump'], function() {
browserSync({
proxy: "local.symfony.domain/app_dev.php"
});

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@fatrex
fatrex / gist:354fb43f7e03c0470197
Created July 31, 2014 13:06
[Magento] Abandoned carts collection
$collection = Mage::getResourceModel('reports/quote_collection');
$collection->prepareForAbandonedReport(); //Optional array for Store Ids
$collection->load();