Skip to content

Instantly share code, notes, and snippets.

View DT3264's full-sized avatar

Daniel Cerna Torres DT3264

  • Guanajuato, México
View GitHub Profile
@DT3264
DT3264 / individual-packages.txt
Created June 16, 2023 14:02
Shared-libs analysis
##################ddd
libmotif-common
libxm4
##################gdb
libbabeltrace1
libboost-regex1.74.0
libdebuginfod-common
libdebuginfod1
libipt2
libsource-highlight-common
@DT3264
DT3264 / test.cpp
Created May 5, 2023 00:56
Stress test to eat all of the ram
#include<iostream>
#include<vector>
#include<map>
#define ll long long
#define v vector
using namespace std;
int main(){
ll lim = 1e9;
v<int> vec;
map<int, bool> mp;
@DT3264
DT3264 / main.py
Created December 2, 2021 05:06
Export music to spotify (fork from agb2k)
from tinytag import TinyTag
from pathlib import Path
from spotipy.oauth2 import SpotifyOAuth
import json
import os
import spotipy
import re
# Input
print("Enter your username:")
@DT3264
DT3264 / GetDominantColorFast.cs
Last active December 17, 2023 08:02
John’s Background Switcher For Windows, Dominant fill color and ordered photos
//Copy-pasted from https://github.com/MrMDavidson/code-samples, http://csharpexamples.com/fast-image-processing-c/ and https://stackoverflow.com/questions/30103425/find-dominant-color-in-an-image
//Modifications
//*The redimension size of the image is 1024 since is fast enough and not too heavy
//*Before calculating the means I add the most used color the number of times it appeared to bias the result more to that color.
//*The parameter of threshold in 25 gived good results in my case
//*The k in the calculated method is not used anymore
//*It inserts at most 4 clusters from deterministic points to always have the same result
//Note: A lot of the code might be expanded, it was extracted from the decompiler
private unsafe static Color GetDominantColour(Image originalImage)