Skip to content

Instantly share code, notes, and snippets.

View popehiflo's full-sized avatar
🏠
Working from home

Pool Petter Hijuela Florian popehiflo

🏠
Working from home
View GitHub Profile
@popehiflo
popehiflo / install_oh_my_posh.sh
Last active March 20, 2024 03:01
Instalar ohmyposh, configurar un tema predeterminado (clean-detailed) con una fuente predeterminada (Meslo). Debemos darle permisos de ejecución con el comando chmod +x install_oh_my_posh.sh y ejecutarlo con ./setup_oh_my_posh.sh. Recuerda que debes ejecutar este script como superusuario si tu usuario no tiene permisos suficientes para realizar …
#!/bin/bash
# Descarga oh-my-posh y lo guarda en /usr/local/bin
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
# Otorga permisos de ejecución al archivo descargado
sudo chmod +x /usr/local/bin/oh-my-posh
# Crea un directorio llamado .poshthemes en tu directorio home para almacenar los temas
mkdir ~/.poshthemes
# Descarga el archivo zip de temas de oh-my-posh en el directorio .poshthemes
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
@popehiflo
popehiflo / useFetch.js
Last active April 1, 2020 13:45
Custom Hook permite extraer logica para una llamada a API
import {useState,useEffect} from "react"
function useFetch(url, initialState, options) {
// data: donde llega la info
// loading: saber si esta cargando la data
// error: el tipo de error
const [data, setData] = useState(initialState)
const [loading, setLoading] = useState(false)
const [error, setError] = useState(null)
public class QuestionA {
public static final String VALIDATE = "true";
public static void main(String []args) {
if(Boolean.valueOf(VALIDATE).equals(true)) {
System.out.println("Entro...");
}
}
}
@popehiflo
popehiflo / HooksConsumirApi.js
Last active March 13, 2020 22:37
Hook consumir API Rest con Fetch
import { useState, useEffect } from 'react';
//consumir API Rest con fetch
const useServices = () => {
const configServiceDefault = {
type: 'GET',
urls: '',
parameters: null,
isrequest: false