Skip to content

Instantly share code, notes, and snippets.

View mftrhu's full-sized avatar

mftrhu

  • Italy
View GitHub Profile
@mftrhu
mftrhu / mud.py
Created August 11, 2016 20:11
The beginning of a (very, very simple) MU* game
#!/usr/bin/env python
import socket
import thread
import logging
import time
import random
HOST = ""
PORT = 4004

Keybase proof

I hereby claim:

  • I am mftrhu on github.
  • I am mftrhu (https://keybase.io/mftrhu) on keybase.
  • I have a public key whose fingerprint is 72C1 98E7 3161 1929 6C37 4055 A45D 2F4C C0A6 DACC

To claim this, I am signing this object:

@mftrhu
mftrhu / google.sh
Last active June 28, 2019 17:48
A simple shell script to get Google search results on the terminal
#! /bin/sh
split () {
awk -F "$1" "{print \$$2}" -
}
between () {
split "$1" 2 | split "$2" 1
}
@mftrhu
mftrhu / gemini-server.rkt
Created May 15, 2021 18:00
A trivial gemini server in 100 lines of racket
#lang racket
;; Limit our memory usage
(custodian-limit-memory (current-custodian) (* 16 1024 1024))
;; Load libraries
(require openssl)
(require racket/date)
(require net/url-string)
;; Define the folders we are going to use
@mftrhu
mftrhu / ddg.sh
Created December 24, 2017 22:10
ddg.sh - Search the internet with DuckDuckGo from your terminal
#!/bin/sh
# ddg.sh - Search the internet with DuckDuckGo from your terminal
# Made with boredom, on Christmas Eve, by mftrhu
# Requirements:
# awk, curl OR wget, sed, head, tail, grep, tput (MAYBE)
available () {
command -v "$1" >/dev/null 2>&1
}