Skip to content

Instantly share code, notes, and snippets.

View danielcharrua's full-sized avatar

Daniel danielcharrua

View GitHub Profile
@danielcharrua
danielcharrua / git-reset.sh
Last active July 11, 2023 06:34 — forked from manparvesh/git-cleanup.sh
Git remove all commits except the current one
#!/usr/bin/env bash
rm -rf .git
git init
git add .
git commit -m "Initial commit"
git remote add origin <git origin url>
git push -u --force origin <branch>
@danielcharrua
danielcharrua / Update .gitignore
Created December 13, 2022 16:22 — forked from c33k/Update .gitignore
Updating .gitignore and cleaning the cache
//First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
//This removes any changed files from the index(staging area), then just run:
git add .
//Commit
git commit -m "Atualizando .gitignore para..."
@danielcharrua
danielcharrua / wp_auto_install.sh
Last active October 20, 2022 13:09 — forked from nicomollet/wp_auto_install.sh
WP-CLI auto install script
#!/bin/bash
# Default options
LOCALE="es_ES"
DB_HOST='localhost:3306'
printf "Name of the project? eg My Project: "
read PROJECT_NAME
printf "Slug of the project? eg myproject: "
@danielcharrua
danielcharrua / weight-required-field.php
Last active April 9, 2020 16:30 — forked from damiencarbery/add-required-attribute.js
Make the 'Weight' field required in WooCommerce Edit Product page.
<?php
/*
Plugin Name: Require Weight field (WooCommerce)
Plugin URI: https://charrua.es
Description: Make weight field required when adding/editing product. Usefull when using weight shipping.
Author: Daniel Pereyra Costas
Author URI: https://charrua.es
Version: 0.1
*/
@danielcharrua
danielcharrua / laravelworker
Last active July 4, 2024 18:56 — forked from ibrunotome/supervisord.service
Install and configure supervisord on centos 7.
[program:app1-laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=<your-php-path> <your-artisan-path> queue:work --tries=3
autostart=true
autorestart=true
numprocs=2
redirect_stderr=true
stdout_logfile=<your-logfile-path>
[program:app2-laravel-worker]
@danielcharrua
danielcharrua / WooCommerce_nif
Last active September 11, 2020 06:23 — forked from Miq3l/functions.php
Adding VAT to WooCommerce
<?php
/**
* Plugin Name: WooCommerce NIF
* Description: Adds NIF fields to WooCommerce
* Version: 1.0
* Author: Daniel Pereyra Costas
* Author URI: https://charrua.es
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html