Skip to content

Instantly share code, notes, and snippets.

Ilgrim /
Created Aug 29, 2021 — forked from owainlewis/
Python socket based chat server
import socket, sys, threading
# Simple chat client that allows multiple connections via threads
PORT = 9876 # the port number to run our server on
__version__ = "0.0.1"
class ChatServer(threading.Thread):
Ilgrim /
Created Jul 20, 2021 — forked from ochinchina/
Async socket demo in java
package asyncsocket;
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.CompletionHandler;
import java.util.concurrent.atomic.AtomicInteger;
Ilgrim /
Created Jul 2, 2021 — forked from serxoz/
Aviso para mellorar a postura sentado
#!/usr/bin/env python
Aviso para que me recorde que me sente ben.
0,20,40 * * * * DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus XDG_RUNTIME_DIR="/run/user/1000" ~/bin/
NOTA: axustar as variables de sesión co UID do teu usuario.

Download and install msys2 64bit

Update msys2

  • Update msys2 64bit after install by running pacman -Syu if pacman needs to be updated you might have to close and reopen the terminal and run pacman -Syu again

Install build tools

  • pacman -S git mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_mixer mingw64/mingw-w64-x86_64-SDL2_image mingw64/mingw-w64-x86_64-SDL2_ttf mingw64/mingw-w64-x86_64-SDL2_net mingw64/mingw-w64-x86_64-cmake make

Compile Hello World

Ilgrim / utf8.c
Last active Jun 19, 2021 — forked from stanislaw/utf8.c
Some C functions to work with UTF-8 string : you can check if a string is valid UTF-8, get the length of a UTF-8 string and replace things in a UTF-8 string. All `char *` arguments must be regular, null-byte terminated, C strings. I've tried to optimize the best I could. I'd be grateful for any suggestions or improvements. Please note I have onl…
View utf8.c
// utf8.c
// training
// Created by Conrad Kleinespel on 5/27/13.
// Copyright (c) 2013 Conrad Kleinespel. All rights reserved.
#include <stdio.h>
#include <stdlib.h>
Ilgrim / InstallingMeld
Created Apr 28, 2021 — forked from kjlubick/InstallingMeld
How to install Meld on Windows and getting it set up with Git
View InstallingMeld
After installing it
I had to tell git where it was:
git config --global merge.tool meld
git config --global diff.tool meld
git config --global mergetool.meld.path “C:\Program Files (x86)\Meld\meld\meld.exe”
And that seems to work. Both merging and diffing with “git difftool” or “git mergetool”
View gist:b899aedfdda944e67d686a627f242519
# first, fetch the latest refs for all branches. And be sure we have latest master, etc
git checkout master
git fetch
# If any changes from remote, catch our local version up
git rebase origin/master
# could also be done as
Ilgrim /
Created Apr 27, 2021 — forked from neuro-sys/
Amstrad CPC 464/6128 Programming Resources

Amstrad CPC 464/6128 Programming Resources

A collection of information gathered from various resources into a single document to be able to program for Amstrad CPC 464/6128 machines.


CPC has the following components on the mainboard:

Ilgrim /
Created Feb 8, 2021 — forked from mikecrittenden/
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains --no-parent
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
Ilgrim /
Created Feb 2, 2021 — forked from dbehnke/
Python AsyncIO Client and Server Example using StreamReader and StreamWriter
""" - AsyncIO Server using StreamReader and StreamWriter
This will create 200 client connections to a server running
It will handshake and run similar to this:
Server: HELLO
Client: WORLD