Skip to content

Instantly share code, notes, and snippets.

View guicattani's full-sized avatar
🐱

Guilherme Cattani guicattani

🐱
  • Marley Spoon GmbH
  • Berlin
View GitHub Profile
@guicattani
guicattani / befunge.rb
Last active May 2, 2024 09:19
Ruby interpreter for Esoteric Language Befunge https://en.wikipedia.org/wiki/Befunge
def interpret(code)
Befunge.new(code).interpret
end
class Array
def second
self[1]
end
def second=(val)
@mikegerber
mikegerber / Fix WSL2 vs VPN networking.md
Last active October 31, 2025 17:57
Fix WSL2 vs VPN networking

The problem

WSL2 uses a random network from the 172.16.0.0/12 RFC1918 private IP address block. And our VPN uses that address block, too, with a route metric of 1 (= most preferred.)

This breaks networking for WSL2. Meh!

The solution

While messing around with the interface/route metric of the VPN network may work around the problem, it also reduces the priority of the VPN. We do not really want this. Additionally, changing the interface metric does not seem to be permanent, so it requires more work when it breaks again.

@lucasecdb
lucasecdb / gdscript.lua
Last active September 9, 2025 10:40
Godot LSP with Neovim inside WSL
-- after/ftplugin/gdscript.lua
local uv = require("luv")
local hostname = vim.fn.hostname() .. '.local'
local ip_address = uv.getaddrinfo(hostname)[1]['addr']
local port = os.getenv('GDScript_Port') or '6005'
local cmd = vim.lsp.rpc.connect(ip_address, port)
local pipe = '/tmp/godot.pipe'
@nodlag
nodlag / easing_functions.gd
Last active July 18, 2025 18:07
Easing Functions for GODOT ENGINE 4 in GDScript
#
# Easing Functions for GODOT ENGINE 4 in GDScript
#
# Created by Javier Garrido Galdón
#
# The MIT License (MIT)
#
# Copyright (c) 2024
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
def positional_arguments(arg1, arg2, arg3)
puts [arg1, arg2, arg3].join(' ')
end
positional_arguments('Hello', 'Jean Luc', 'Picard')
def positional_with_hash(arg, opts = {})
puts [arg, opts[:firstname], opts[:lastname]].join(' ')
end
@lenicyl
lenicyl / CompileAP.md
Last active August 21, 2025 16:29
How to build ArmorPaint
# Set vi key bindings mode
set -g mode-keys vi
set -g status-keys vi
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# List of plugins
@jubicode
jubicode / select_by_color.py
Last active May 31, 2025 19:27 — forked from tamask/select_by_color.py
Select By Color (Blender)
import bpy
from mathutils import Color
bl_info = {
'name': 'Select By Color',
'author': 'Tamas Kemenczy, updated for 2.8 by Piotr Zgodziński',
'version': (0, 2),
'blender': (2, 80, 3),
'location': 'View3D > Specials > Select By Color',
'description': 'Select all faces with the same vertex color of the selected face',
@Janderson
Janderson / ShareAFolderWithWindowsUsingVirtualBox.me
Last active May 29, 2019 18:09
Docker share folder with windows using virtualbox
First using virtualbox interface, go to dockermachine usually it named as default, after that go to Shared Folders > Shared Folder Settings and share choose a folder into windows usually I choose my projects folder and choose a name [NameOfYourSharedFolder].
# create a volume into docker
docker volume create projects
# remove the old folder data
rmdir /mnt/sda1/var/lib/docker/volumes/projects/_data/
@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active September 23, 2025 07:20
setup L2TP IPSEC VPN in archlinux using NetworkManager