Skip to content

Instantly share code, notes, and snippets.

View trapped's full-sized avatar
🏠
Working from home

Giorgio Pellero trapped

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am trapped on github.
  • I am trapped (https://keybase.io/trapped) on keybase.
  • I have a public key whose fingerprint is 330B 5545 AA92 E7EF 40E7 1732 A709 8F60 D37B AB37

To claim this, I am signing this object:

@trapped
trapped / jaccard.md
Last active August 29, 2015 14:04
Go implementation of the Jaccard Index/Distance

The Jaccard Index' formula looks like the following:

formula

and the Jaccard Distance's formula:

formula

The values obtained are between 0 and 1 (both included):

@trapped
trapped / rotmgs.erl
Created July 17, 2014 00:32
RotMG proof-of-concept server in Erlang
%% RotMG game module
-module(rotmgs).
-export([start/0, read/1, processpacket/2, send/2]).
-define(PORT, 2050).
-define(TCP_OPTIONS, [binary,
{packet, 0},
{active, false},
{backlog, 1024},
@trapped
trapped / scytale.c
Last active May 11, 2021 19:06
Scytale encryption (ancient greek technique) in C - https://en.wikipedia.org/wiki/Scytale
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void scytale(char* plain, int key, char* encrypted) {
int length = strlen(plain);
for(int i = 0; i < key; i++) {
for(int ii = i; ii < length; ii += key) {
encrypted[strlen(encrypted)] = plain[ii];
printf("col:%d row:%d current:'%c'\n",
@trapped
trapped / .Xdefaults
Created June 4, 2014 23:17
urxvt configuration in .Xdefaults/.Xresources
URxvt.scrollBar: false
URxvt.font: xft:terminus:size=14
*font: -misc-terminus-medium-*-*--14-101-*-*-*-*-*
URxvt.perl-ext-common: default,matcher,url-select
URxvt.url-launcher: chromium
URxvt.url-select.underline: true
URxvt.matcher.button: 1
@trapped
trapped / checkgits.sh
Created June 4, 2014 21:58
Create a status bar using LemonBoy/bar - disclaimer: terrible update checking
#|/bin/bash
# Folder containing other folders (git repositories) or symlinks to them
WORKFLDR="$HOME/Git"
# Count of updated repositories
updatedc=0
updnames=()
# Whether or not to stay quiet
QUIET="false"
# Where to output the data to