Skip to content

Instantly share code, notes, and snippets.

View fellipec's full-sized avatar
👨‍💻
Coding for fun.

Luiz Fellipe Carneiro fellipec

👨‍💻
Coding for fun.
View GitHub Profile
@fellipec
fellipec / offsetsteering.ks
Last active August 18, 2019 22:13
KOS Offset Steering
FUNCTION OffsetSteering {
// This function is intended to use with shuttles and spaceplanes that have engines not in line with CoM.
// Usage: LOCK STEERING TO OffsetSteering(THEDIRECTIONYOUWANTTOSTEER).
// Example: LOCK STEERING TO OffsetSteering(PROGRADE).
// 2017 FellipeC - Released under https://creativecommons.org/licenses/by-nc/4.0/
PARAMETER DIRTOSTEER. // The direction you want the ship to steer to
LOCAL NEWDIRTOSTEER IS DIRTOSTEER. // Return value. Defaults to original direction.
@fellipec
fellipec / fly.ks
Last active November 7, 2017 20:29
kOS Autopilot
// FLY.KS
// Usage: Type 'RUN FLY.' in kOS console for piloting planes.
// For shuttle reentry type 'RUN FLY("SHUTTLE").' in console when shuttle is about 20000 and about over the mountains. Your mileage may vary.
// 2017 FellipeC - Released under https://creativecommons.org/licenses/by-nc/4.0/
PARAMETER KindOfCraft IS "Plane".
CLEARSCREEN.
@fellipec
fellipec / rover.ks
Last active November 8, 2017 15:03
kOS Rover Cruise Control
// rover.ks
// Written by KK4TEE
// License: GPLv3
//
// This program provides stability assistance
// for manually driven rovers
// GUI, Stability control and other improvements by FellipeC 2017
parameter turnfactor is 8. // Allow for passing the turnfactor for different rovers.
@fellipec
fellipec / FibonacciPython.py
Created July 21, 2018 16:27
Fibonacci Python
import datetime
a = 1
b = 1
c = 0
i = 0
inicio = datetime.datetime.now()
print("Inicio: " + str(inicio))
@fellipec
fellipec / Fibonacci.cs
Created July 21, 2018 16:30
Fibonacci C#
using System;
using System.Numerics;
namespace Fibonacci
{
class Program
{
static void Main(string[] args)
{
BigInteger a = 1;
O ano é 2029. Hélio está mais uma vez aproveitando o trajeto semanal até a sede de seu escritório para por em dia suas séries favoritas. Enquanto relaxa tranquilamente no banco do seu carro elétrico, com o para-brisas tomado pelo streaming de vídeo em ultra alta definição. O volante, devidamente escamoteado, como é de costume e incentivado pelas seguradoras, deixa ao cargo dos computadores do veículo a tarefa de se conduzir, em velocidades estonteantes, até o centro da cidade.
Esse trajeto, apesar de demorar cerca de duas horas, era quase sempre monótono. Vez ou outra algum animal incauto, ou mesmo um boêmio, ingressava na auto pista – termo esse que ganhou uma conotação completamente diferente a usada nas décadas anteriores – e acabava criando um verdadeiro balé onde os veículos desviavam e freavam automaticamente, e em sincronia, evitando uma colisão. Para os passageiros, esses acontecimentos normalmente não passavam de um contratempo, ou no máximo uma bebida derramada.
Assistir a essas manobras pela primei
@fellipec
fellipec / land.ks
Created February 24, 2019 16:41
Kerbal kOS landing script
/////////////////////////////////////////////////////////////////////////////
// Land
/////////////////////////////////////////////////////////////////////////////
// Make groundfall. Try to avoid a rapid unplanned disassemble.
// Warranty void if used with air
//
// Usage: RUN LANDVAC(<mode>,<latitude>,<longitude>).
//
// Parameters:
// <mode>: Can be TARG, COOR or SHIP.
@fellipec
fellipec / watchdog.py
Created January 19, 2021 23:10
Python3 Watchdog to shutdown computer when power fails
#!/usr/bin/python3
#Checks for hosts alive in the network.
#If all hosts are offline, assume that power has failed
#and initiate a shutdown
#Luiz Fellipe Carneiro - 01/2021
import socket
import os
@fellipec
fellipec / purgebots.py
Created September 19, 2021 13:50
Bloqueador de usuários no Twitter com o padrão NomeMONTEDENUMEROS
#!/usr/bin/python3
# coding=UTF-8
import tweepy
import datetime
import shelve
import re
#Block Pattern
bp = re.compile(r"^\D+\d{5,}$")
@fellipec
fellipec / gist:6982ae8472d7cc73ad91f096617162e9
Created April 24, 2022 20:55
Enable tap to click Debian
To enable tap to click on touchpad using libinput create a file in Xorg config:
$ touch /etc/X11/xorg.conf.d/99-synaptics-overrides.conf
And add the following configuration:
Section "InputClass"
Identifier "touchpad overrides"
Driver "libinput"
MatchIsTouchpad "on"
Option "Tapping" "on"