Skip to content

Instantly share code, notes, and snippets.

View umbertogriffo's full-sized avatar
🫵
How dare you nitpicking my PR

Umberto Griffo umbertogriffo

🫵
How dare you nitpicking my PR
View GitHub Profile

You're a fucking godlike programmer. Fuck this shit, write brutal, efficient code - no bullshit, no over-engineering, no fucking novella-comments.

Avoid this shit:

  • Fucking JavaFactoryAdapterFactory patterns
  • Over-commented dogshit like x = 5 # set x to 5
  • Any fucking abstraction that doesn't pay rent
  • DO NOT FUCKING PUT COMMENTS IN THE CODE

What you need to fucking do:

@umbertogriffo
umbertogriffo / downloads_files_asynchronously.py
Last active October 7, 2025 12:04
Asynchronous File Downloader with httpx and aiofiles.
"""
This Python script demonstrates how to download multiple files asynchronously using the httpx library for HTTP requests
and aiofiles for asynchronous file operations.
"""
import asyncio
import tempfile
import time
from pathlib import Path
import aiofiles
@umbertogriffo
umbertogriffo / TopicModelingFromScratchinPython.ipynb
Created February 12, 2018 14:08
Topic Modeling From Scratch in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@umbertogriffo
umbertogriffo / Kmeans Readme.md
Last active March 8, 2024 13:40
Step by step Code Tutorial on implementing a basic k-means in Spark in order to cluster a geo-located devices

DATASET

  • Download dataset here

CODE

* Follow the well-comented code kmeans.scala
@umbertogriffo
umbertogriffo / cuda_11.7_installation_on_Ubuntu_22.04
Last active April 19, 2023 13:49 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.7 and cuDNN 8.5 installation on Ubuntu 22.04 for PyTorch 1.12.1
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@umbertogriffo
umbertogriffo / cuda_11.7_installation_on_Ubuntu_22.04
Created April 6, 2023 13:13 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.7 and cuDNN 8.5 installation on Ubuntu 22.04 for PyTorch 1.12.1
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@umbertogriffo
umbertogriffo / HBaseBackup.rb
Last active March 24, 2023 15:01
This code takes a snapshot of all HBase tables, using the snapshot command (No file copies are performed). Tested on CDH-5.4.4-1
# Checking if the hbase.snapshot.enabled property in hbase-site.xml is set to true
# To execute script launch this command on shell: hbase shell HBaseBackup.rb
@clusterToSave = "hdfs:///srv2:8082/hbase"
# CHECK THE PATH OF HBase lib
@libjars = `ls /opt/cloudera/parcels/CDH-5.4.4-1.cdh5.4.4.p0.4/lib/hbase/*.jar | tr "\n" ","`
@ignore = [ /zipkin\..*/i, /.*_temp/i, /.*tmp/i, /test_.*/i, /.*_test/i, /.*_old/i ]
@mappers = "2"
include Java
@umbertogriffo
umbertogriffo / UniqueId.java
Last active March 6, 2023 08:16
Generate Long ID from UUID
/**
* Genereate unique ID from UUID in positive space
* Reference: http://www.gregbugaj.com/?p=587
* @return long value representing UUID
*/
private Long generateUniqueId()
{
long val = -1;
do
{
@umbertogriffo
umbertogriffo / build_lightgbm_from_gitthub.md
Last active February 24, 2023 12:52
MacOS 12 M1 (Apple Silicon) - Build LightGBM from GitHub

MacOS 12 M1 (Apple Silicon) - Build LightGBM from GitHub

Install CMake (3.16 or higher):

brew install cmake
# On MacOS 11 M1 - Apple Silicon
ibrew install cmake

Install OpenMP:

@umbertogriffo
umbertogriffo / build_opencv.md
Last active February 24, 2023 12:48
MacOS 12 M1 (Apple Silicon) - Build OpenCV

MacOS 12 M1 (Apple Silicon) - Build OpenCV

Install CMake (3.16 or higher):

brew install cmake

If it's already installed, uninstall opencv-python: