Skip to content

Instantly share code, notes, and snippets.

View horaciod's full-sized avatar
💭
aprendiendo todo lo posible

Horacio Degiorgi horaciod

💭
aprendiendo todo lo posible
View GitHub Profile
@ignasbernotas
ignasbernotas / SetModelAttributes.php
Last active July 5, 2022 12:53
A super simple artisan command to generate setting model properties
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
class SetModelAttributes extends Command
{
@claudiodekker
claudiodekker / megapint.sh
Created June 22, 2022 22:48
Opinionated Laravel Pint alias. Prefers a repo-specific version of pint over a globally-installed one, and defaults to use the Laravel preset.
megapint() {
PINT=$([ -f "vendor/bin/pint" ] && echo "vendor/bin/pint" || echo "pint")
"$PINT" --preset laravel $@
}
@horaciod
horaciod / readme-change.md
Last active September 13, 2021 22:23
implementing Google Analytics on vufind 7.x (universal with CSP)

cambio en vufind para google analytics.

We need to change one php file module/VuFind/src/VuFind/View/Helper/Root/GoogleAnalytics.php

on function "getRawJavascript"

//new code that insert the nonce attribute on "script" tag created by s.createElement()
 if ($this-&gt;universal) {
@kbzone
kbzone / pdf_generator.php
Created September 6, 2021 15:40
Generador de Factura AFIP en PDF
<?php
require_once(dirname(__FILE__) . '/library/TCPDF-main/tcpdf.php');
require_once(dirname(__FILE__) . '/library/FPDI-master/src/autoload.php');
use setasign\Fpdi;
class Pdf extends Fpdi\Tcpdf\Fpdi
{
protected $tplId;
private $source_file;
@horaciod
horaciod / enrolldecurso_a_curso.sh
Created August 8, 2019 22:24
moodle enroll all students from on course to another using moosh https://moosh-online.com/commands/
#!/bin/bash
# dos parámetros / two parameters
# ex. ./enrolldecurso_a_curso.sh --id 20 715
# $1 curso orign $2 curso destino
# ### path of the moodle root
cd /datos/webs/moodle36/html
#export curso
php /home/desarrollo/moosh/moosh.php user-list --course=$1 --id >/tmp/exportados.txt
#exit 111
@horaciod
horaciod / .pdmenurc
Last active September 28, 2018 04:14
pequeño menu para los repositorios GIT
#!/usr/bin/pdmenu
#sencillo menu para usar con la utilidad pdmenu http://joeyh.name/code/pdmenu/ que permite hacer un menu en la terminal de linux.
# en ubuntu se instala con apt install pdmenu
# este archivo va en el directorio home del usuario
# version mejorada con submenus y accesos ssh usando la terminal de gnome.
#colores
color:desktop:blue:blue
color:title:blue:white
@dweldon
dweldon / install-docker.sh
Last active April 8, 2022 11:18
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active November 12, 2023 23:00
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 7, 2024 17:48
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)