Skip to content

Instantly share code, notes, and snippets.

View seupedro's full-sized avatar

Seu Pedro seupedro

View GitHub Profile
@seupedro
seupedro / gist:56da58da1900c2c5006c5120392e38f2
Last active March 9, 2024 21:42
docker install ubuntu 20.04 full script
#!/bin/bash
#remove old packages
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
#update repositories
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
<picture>
<a href ="https://github.com/xyz">
<img alt="Logo" src="https://xyz">
</a>
</picture>
@seupedro
seupedro / Emoji-on-Ubuntu.md
Last active March 3, 2024 05:02 — forked from arafathusayn/Emoji-on-Ubuntu.md
Guide to enable system-wide Emoji support on Ubuntu 🤩

1. Install Fonts

sudo apt install fonts-noto-color-emoji

2. Add Font Configuration

  • Open ~/.config/fontconfig/conf.d/01-emoji.conf file in an editor.
  • Copy-paste the lines below:
@seupedro
seupedro / humanDetectorKarl.py
Created July 16, 2021 01:11
A simple human detector
import cv2
import imutils
import numpy as np
import argparse
HOGCV = cv2.HOGDescriptor()
HOGCV.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
def detect(frame):
@seupedro
seupedro / latest.log
Created May 23, 2020 03:07
Server giving random error without any plugin activated
[02:58:34] [Server thread/INFO]: seupedro joined the game
[02:58:34] [Server thread/INFO]: seupedro[/177.140.71.244:62771] logged in with entity id 245 at ([world]-83.25262847678547, 122.48119212218525, 2389.35719978464)
[02:58:59] [Server thread/INFO]: seupedro issued server command: /tps
[02:59:29] [Server thread/INFO]: TPS from last 1m, 5m, 15m: 20.0, 20.0, 20.0
[03:01:33] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - git-Paper-307 (MC: 1.15.2) ---
[03:01:33] [Paper Watchdog Thread/ERROR]: The server has not responded for 20 seconds! Creating thread dump
[03:01:33] [Paper Watchdog Thread/ERROR]: ------------------------------
[03:01:33] [Paper Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[03:01:33] [Paper Watchdog Thread/ERROR]: ------------------------------
[03:01:33] [Paper Watchdog Thread/ERROR]: Current Thread: Server thread
@seupedro
seupedro / privacy.mk
Last active July 27, 2018 20:19
Visual Timer - Privacy Policy
Veja abaixo / See below
@seupedro
seupedro / stacktrace.log
Created July 27, 2018 13:12
Android Kitkat bug on setResquetedOrientation Method (Possible Genymotion Emulator)
07-26 22:13:14.046 3912-3912/? D/dalvikvm: Late-enabling CheckJNI
07-26 22:13:14.130 3912-3912/example.android.com I/dalvikvm: Could not find method android.view.Window$Callback.onPointerCaptureChanged, referenced from method android.support.v7.view.WindowCallbackWrapper.onPointerCaptureChanged
07-26 22:13:14.130 3912-3912/example.android.com W/dalvikvm: VFY: unable to resolve interface method 20920: Landroid/view/Window$Callback;.onPointerCaptureChanged (Z)V
07-26 22:13:14.130 3912-3912/example.android.com D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
07-26 22:13:14.130 3912-3912/example.android.com I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts
07-26 22:13:14.130 3912-3912/example.android.com W/dalvikvm: VFY: unable to resolve interface method 20922: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V
07-26 22:13:14.130 3
@seupedro
seupedro / DateFormattingBasedOnLocale.java
Created June 2, 2018 13:40
Formate date based on User Locale on Android
String weddingDate = "26/02/1974";
/* Specify which format is */
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date date = null;
try {
/* Parse to date object */
date = sdf.parse(weddingDate);
} catch (ParseException e) {
// handle exception here !
@seupedro
seupedro / changeDrawableXmlColorOnAndroid.java
Created May 31, 2018 11:44
How to change Icon color (Drawable, XML, whatever you want), on Android dynamically (programmatically, whatever)
// Explained Method
Drawable deleteIcon = ContextCompat.getDrawable(context, R.drawable.ic_delete);
Drawable deleteIconCompat = DrawableCompat.wrap(deleteIcon).mutate();
Drawable deleteIconMute = deleteIconCompat.mutate();
DrawableCompat.setTint(deleteIconMute, Color.RED);
// Compact Method
DrawableCompat.setTint(
DrawableCompat.wrap(
ContextCompat.getDrawable(context, R.drawable.ic_check).mutate()), Color.WHITE);
@seupedro
seupedro / CursorRecyclerAdapter.java
Created May 27, 2018 01:42 — forked from Shywim/CursorRecyclerAdapter.java
A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc.
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matthieu Harlé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is