Skip to content

Instantly share code, notes, and snippets.

View juanmacuevas's full-sized avatar

Juanma Cuevas juanmacuevas

View GitHub Profile
@facelessuser
facelessuser / exploring-tonal-palettes.md
Last active April 26, 2024 17:59
Exploring Tonal Palettes

Exploring Tonal Palettes

HCT

HCT is a color model developed by [Google][material-hct]. It aims to solve a problem related to generating color palettes with good contrast. While HCT may seem like a revolutionary color model, the idea behind it is quite simple, take the perceptually uniform color model CAM16 and combine it with the CIE Lab's lightness.

Upside of HCT

@josemirm
josemirm / crear_bd.sql
Last active April 5, 2022 08:36
Crear base de datos de SQLite usando los archivos CSV disponibles
-- Josemi Rodríguez
-- Script en SQL para convertir los ficheros "juridicas_1.csv", "juridicas_2.csv", y "convocatorias.csv" en una base de datos.
-- Uso: Se ejecuta "sqlite3 <nombre_base_datos>" y dentro de la interfaz de comandos de SQLite se escribe ".read crear_bd.sql"
-- La aplicación presupuestaria es una fecha con texto extra.
-- Por ejemplo "2022-03-3321-46203", cuando la fecha de concesión fue 24/03/2022
create table juridicas(
id integer not null,
id_convocatoria integer not null,
@munificent
munificent / generate.c
Last active April 30, 2024 15:27
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@gabrielemariotti
gabrielemariotti / README.md
Last active March 9, 2023 06:02
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@fada21
fada21 / PicassoBigCache.java
Last active March 14, 2018 10:34
Disk cache larger size for Picasso OkHttp (use like PicassoBigCache.INSTANCE.getPicassoBigCache(ctx) -> rest as in regular Picasso api .
package com.?
import java.io.File;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.os.StatFs;
import com.squareup.picasso.Downloader;
@hagberg
hagberg / wrom.py
Created December 15, 2013 22:22
generate non-isomorphic free trees or rooted trees
#!/usr/bin/env python
"""Implementation of the Wright, Richmond, Odlyzko and McKay (WROM)
algorithm for the enumeration of all non-isomorphic free trees of a
given order. Rooted trees are represented by level sequences, i.e.,
lists in which the i-th element specifies the distance of vertex i to
the root."""
import sys