Skip to content

Instantly share code, notes, and snippets.

View rockdrigo's full-sized avatar

Rodrigo Satch rockdrigo

View GitHub Profile
@rockdrigo
rockdrigo / git-alias.md
Created June 5, 2022 20:46 — forked from Klerith/git-alias.md
Useful Git Alias

Log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

Status

git config --global alias.s status --short

Alternativa útil de status

git config --global alias.s status -sb

public class Polinomio{
private int[] coeficientes;
private int grado;
public Polinomio(int g){
if (g < 0) {
coeficientes = new int[1];
coeficientes[0] = 0;
grado = 0;
} else {
@rockdrigo
rockdrigo / gist:0ffa5b89af049ee42adb
Last active July 12, 2019 19:59
Sublime User Preferences
{
"font_size": 12,
"bold_folder_labels": true,
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@rockdrigo
rockdrigo / laravel-controller-method-commands.php
Last active May 30, 2018 05:42
Call laravel controller methods via command line Raw
<?php
php artisan tinker
$controller = app()->make('App\Http\Controllers\MyController');
app()->call([$controller, 'myMethodName'], []);
//the last [] in the app()->call() can hold arguments such as [user_id] => 10 etc'
@rockdrigo
rockdrigo / functions.php
Created November 27, 2017 03:57
Descuento automatico al agregar al carrito de compras WooCommerce
//Cupón descuento automático
add_action( 'woocommerce_before_cart', 'apply_matched_coupons' );
function apply_matched_coupons() {
global $woocommerce;
$coupon_code = 'cupon_code'; // aquí tu código de cupón
if ( $woocommerce->cart->has_discount( $coupon_code ) ) return;
if ( $woocommerce->cart->cart_contents_total >= 1 ) {
$woocommerce->cart->add_discount( $coupon_code );
$woocommerce->show_messages();
}
@rockdrigo
rockdrigo / speedtest.sh
Created October 21, 2017 15:34
Linux SpeedTest Commands
#!/bin/bash
git clone https://github.com/sivel/speedtest-cli.git
cd speedtest-cli
echo "run -> python speedtest-cli/speedtest.py"
@rockdrigo
rockdrigo / gist:f72a957dc92cd5eeb18f
Created July 18, 2015 02:49
permisos wordpress
#!/bin/bash
echo "comenzamos con la asignacion de permisos, no tardamos"
echo "asignando permisos 664 a archivos"
find . -type f -exec chmod 664 {} \;
echo "asignando permisos 775 a carpetas"
find . -type d -exec chmod 775 {} \;
echo "be happy litle pinguin"
@rockdrigo
rockdrigo / port.conf
Created June 28, 2016 15:59
Port Conf NGINX file
listen 80;
@rockdrigo
rockdrigo / Curl.php
Created June 28, 2016 05:17
Magento 1.9.2 Unknown cipher in list: TLSv1 SolveFile
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@rockdrigo
rockdrigo / mirroCentos.txt
Created May 20, 2016 01:44
Centos Mirrors Original Source
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/