Skip to content

Instantly share code, notes, and snippets.

View jhernan33's full-sized avatar

Hernan jhernan33

  • venezuela
View GitHub Profile
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active March 3, 2025 19:37
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <[email protected]>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@joseluisq
joseluisq / 1README.md
Last active January 3, 2022 13:22
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

Lumen 5 HTTP Exception Handlers with JSON support.

Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

image

Setup

Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php and app/Http/Middleware/Authenticate.php

@illume
illume / image_save.py
Created February 12, 2017 16:02
A tool for saving files to and from a postgresql db BYTEA table.
"""A tool for saving files to and from a postgresql db.
"""
import os
import sys
import argparse
import psycopg2
db_conn_str = "postgresql://username:password@localhost:5432/dbname"
create_table_stm = """
CREATE TABLE files (
@pierrejoubert73
pierrejoubert73 / array_agg_example.sql
Last active July 17, 2022 23:00
An example of using the array_agg() PostgreSQL function.
select
pc_games.title,
to_char(pc_games.release_date, 'YYYY-MM-DD') as release_date
array_to_string(array_agg(avid_fans.firstname || ' ' || avid_fans.surname), ', ', null) as fans
from
schema_A.pc_games as pc_games
inner join schema_A.avid_fans as avid_fans on (pc_games.id = avid_fans.fk_pc_game_id)
where
pc_games.release_date > '2004-12-31'
group by
@aviskase
aviskase / Postman.desktop
Last active January 22, 2025 01:08
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@edgardo001
edgardo001 / nacionalidad.sql
Created September 29, 2016 20:08
Insert SQL de nacionalidades, gentilicios e ISO de cada pais
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Afganistán','AFGANA','AFG');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Albania','ALBANESA','ALB');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Alemania','ALEMANA','DEU');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Andorra','ANDORRANA','AND');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Angola','ANGOLEÑA','AGO');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('AntiguayBarbuda','ANTIGUANA','ATG');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('ArabiaSaudita','SAUDÍ','SAU');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Argelia','ARGELINA','DZA');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Argentina','ARGENTINA','ARG');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Armenia','ARMENIA','ARM');
@vielhuber
vielhuber / script.sh
Last active February 11, 2025 18:38
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@ramiroaznar
ramiroaznar / query.sql
Created August 12, 2016 12:17
How to find duplicate values with PostgreSQL
select * from table t1
where (select count(*) from table t2
where t1.field = t2.field) > 1
order by field
@mrroot5
mrroot5 / docker_container_image_remove.md
Last active April 4, 2022 19:21
Borrar contenedores e imágenes de docker. También <none>. Keyords: prune, docker, images, docker images, docker prune, stop, docker stop, docker ps, ps.

Intro

En este fichero vas a aprender algunos comandos básicos para parar y eliminar contenedores además de imágenes de docker.

Contenedores

Parar todos los contenedores

docker stop $(docker ps -a -q)
@rashkopetrov
rashkopetrov / mongodb_and_php7.md
Last active December 3, 2019 14:28
Install MongoDB and make it work with PHP 7.0

Install MongoDB

  1. Import the public key used by the package management system.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
  1. Create a list file for MongoDB.