Skip to content

Instantly share code, notes, and snippets.

View mdtrooper's full-sized avatar

Miguel de Dios Matias mdtrooper

View GitHub Profile
@matthen
matthen / hello_world.py
Last active August 29, 2024 12:50
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List

A funky shell thingy that I've never seen before

So you're in posix sh and you want to do the equivalent of this in bash:

foo | tee >(bar) >(baz) >/dev/null

(Suppose that bar and baz don't produce output. Add redirections where needed if that's not the case.)

@lleyton
lleyton / translation.md
Last active January 23, 2024 16:53
(ENG) Open Source Business Challenges and Reality, Rui Ueyama

Open Source Business Challenges and Reality

Original Japanese note here.

Original Author: Rui Ueyama (creator of the mold linker)

Translated by @windowsboy111

Minimally edited by @lleyton

@huytd
huytd / wordle.md
Last active November 1, 2024 05:07
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@bpsib
bpsib / BBC-Radio-HLS.m3u
Last active November 14, 2024 10:33 — forked from stengland/BBC-Radio.m3u
BBC Radio Streams
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one/bbc_radio_one.isml/bbc_radio_one-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Xtra
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_1xtra/bbc_1xtra.isml/bbc_1xtra-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Dance
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one_dance/bbc_radio_one_dance.isml/bbc_radio_one_dance-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1 Anthems (UK Only)
http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_radio_one_anthems/bbc_radio_one_anthems.isml/bbc_radio_one_anthems-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 2
@aaferrari
aaferrari / bloglenovo statistics.tsv
Last active February 11, 2020 09:45
Estadisticas de comentarios en bloglenovo.es obtenidas con https://gist.github.com/aaferrari/fbd3d861771aa255b52b9f5500fe9e3b
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 3 columns, instead of 1 in line 8.
Enlace Titulo Comentarios
bloglenovo.es/de-50-gramos-8-kilos-mini-altavoces-y-super-loros-para-el-movil/ De 50 gramos a 8 kilos, mini altavoces y super loros para el móvil 1
bloglenovo.es/igrill-el-termometro-digital-que-controlas-desde-tu-smartphone/ iGrill, el termómetro digital que controlas desde tu smartphone 1
bloglenovo.es/asi-seran-los-cuadros-del-futuro/ Así serán los cuadros del futuro 2
bloglenovo.es/es-necesario-desenchufar-la-tablet-una-vez-cargada/ ¿Es necesario desenchufar la tablet una vez cargada? 0
bloglenovo.es/cual-es-la-mejor-manera-de-limpiar-la-pantalla-del-movil-y-tablet/ ¿Cuál es la mejor manera de limpiar la pantalla del móvil y tablet? 0
bloglenovo.es/entrevista-aymar-de-lencquesaing-en-el-blog-xataka/ Entrevista a Aymar de Lencquesaing en el blog Xataka 0
bloglenovo.es/lenovo-presenta-resultados-y-habla-de-sus-productos-articulo-en-tic-beat/ Lenovo presenta resultados y habla de sus productos. Artículo en TIC BEAT 0
bloglenovo.es/preparate-para-la-vuelta-la-oficina-estos-son-los-17
@aaferrari
aaferrari / bloglenovo comments stats.py
Last active February 11, 2020 09:34
Obtiene la cantidad de comentarios que hay en los posts de bloglenovo.es (funciona con Python 2 y 3)
import re, json
from requests import request
from sys import version_info
if version_info.major == 2:
from urllib import urlencode
elif version_info.major == 3:
from urllib.parse import urlencode
unichr=chr
@aaferrari
aaferrari / No code diagram.txt
Last active May 7, 2020 23:43
ASCII diagram compatible with ditaa (https://github.com/stathissideris/ditaa). Output is https://i.imgur.com/phq0Yf9.png after processing
La felicidad de las nocode tools.
+----------------+ +--------+
|👤 Usuario feliz| |{d} |
+------------+---+ |Fichero |
| |proyecto|
| /--+--------+
| |
v v
+------+
|{io} |
@fnky
fnky / ANSI.md
Last active November 15, 2024 17:29
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@ummahusla
ummahusla / git-overwrite-branch.sh
Last active September 5, 2024 13:48 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name