Skip to content

Instantly share code, notes, and snippets.

View mariogarcia-ar's full-sized avatar
🎯
Focusing

Mario Garcia mariogarcia-ar

🎯
Focusing
  • https://TuCuota.Online
  • Rosario, Santa Fe, Argentina
View GitHub Profile
#!/bin/bash
# Stop all running containers
echo "Stopping all running containers..."
docker stop $(docker ps -a -q)
# Remove all containers
echo "Removing all containers..."
docker rm $(docker ps -a -q)
@mariogarcia-ar
mariogarcia-ar / bearer-token.php
Created February 11, 2024 18:55 — forked from wildiney/bearer-token.php
[deprecated] PHP - How to get and set Bearer Token
<?php
/**
* ALERT! There are more than ten years since I wrote the first version (adaptation) of this code with PHP 5.6,
* then I changed my code stack and I couldn't mantain this code anymore. Ten years ago worked like a charm.
* Fell free to test, use, fork, update, etc. and if possible put in the comments how to fix,
* if it doesn't work for you as it is, so other people could find answers.
**/
/**
* Get hearder Authorization
@mariogarcia-ar
mariogarcia-ar / README.md
Created December 29, 2023 21:31 — forked from nielslange/README.md
Genesis Framework snippets

Genesis Framework snippets

Accessibility

Enable Accessibility Features

  • functions.php:
//* Enable Genesis Accessibility Components
add_theme_support( 'genesis-accessibility', array( '404-page', 'drop-down-menu', 'headings', 'rems', 'search-form', 'skip-links' ) );
@mariogarcia-ar
mariogarcia-ar / gsap-3-intro-animation.markdown
Created September 17, 2023 14:54
GSAP 3 Intro Animation
@mariogarcia-ar
mariogarcia-ar / Update-branch.md
Created September 10, 2023 16:49 — forked from santisbon/Update-branch.md
Deploying from #Git branches adds flexibility. Bring your feature branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master.

@mariogarcia-ar
mariogarcia-ar / imageCompression.sh
Created August 29, 2023 21:49 — forked from caubry/imageCompression.sh
Bash script using pngquant and jpegoptim library to compress PNG, JPG and JPEG, with batch compression as an option.
#!bin/bash
pwd=`pwd`
# Set the quality factor to 80
qualityCompression=80;
# Set a minimum quality factor to 20
qualityLimit=20;
# To run a new compression
second_run_compression=false;
# For batch compression
@mariogarcia-ar
mariogarcia-ar / imageresizing.php
Created August 25, 2023 07:11 — forked from georgymh/imageresizing.php
PHP Image resizing and cropping methods.
<?php
/*
Creates a thumbnail keeping the aspect ratio of the source image, and
saves it to a destination $dest.
Credits: http://davidwalsh.name/create-image-thumbnail-php
*/
function make_thumb($src, $dest, $desired_width) {
$info = getimagesize($src);
# invocamos el canister a traves de lineas de comandos
dfx canister call hello_backend greet everyone
# nos retorna
# ("Hello, everyone!")
# creamos el proyecto
dfx new hello
cd hello
# iniciamos el servicio
dfx start --background
# desplegamos la solucion
dfx deploy
# instalamos el sdk, anexo un hotfix por certificado
sh -ci "$(curl -fsSLk https://internetcomputer.org/install.sh)"
# add to .bashrc
export PATH=${HOME}/bin:${PATH}