Skip to content

Instantly share code, notes, and snippets.

View MM-coder's full-sized avatar
:shipit:
Hunting them bugs

Mauro M. MM-coder

:shipit:
Hunting them bugs
View GitHub Profile
@MM-coder
MM-coder / traffic_sensor.ino
Last active October 15, 2019 17:54
System to stop a traffic light when a "vehicle" gets too close
int green = 2;
int yellow = 3;
int red = 4;
int trigPin = 5;
int echoPin = 6;
// ECHO to RX0
long duration;
int distance;
@MM-coder
MM-coder / rps_dynamic.py
Created October 12, 2019 10:49
Dynamically typed rock paper scissors game
# Interactive @ https://repl.it/@ItsMMgamer/EminentNavajowhiteLanserver
import random
choices = ['rock', 'paper', 'scissors']
user_list = ['rock:scissors', 'scissors:paper', 'paper:rock', 'scissors:rock']
computer_choice = random.choice(choices)
user_choice = str(input('Rock, Paper, Scissors?'))
@MM-coder
MM-coder / interval_intersect.py
Created October 12, 2019 10:26
Python program to calculate if a interval intersects (2 tuples)
def interval_intersect(a, b, c, d):
if (c <= b) and (a <= d) == False:
return False
else:
return True
def process(input: bool):
if input == False:
return "does not"
else:
@MM-coder
MM-coder / point_calc.py
Last active October 12, 2019 09:55
Python program to calculate the distance between 2 points (2 tuples)
# Interactive @ https://py3.codeskulptor.org/#user304_lfQquGbAhO_0.py
import math
def point_distance(x0: int, y0: int, x1: int, y1: int):
result = math.sqrt((x0 - x1) ** 2 + (y0 - y1) ** 2))
return result
x1 = int(input("Value for x1: "))
@MM-coder
MM-coder / index.html
Created June 3, 2019 18:22
input :not(:placeholder-shown)
<label for="inp" class="inp">
<input type="text" id="inp" placeholder="&nbsp;">
<span class="label">Label</span>
<span class="border"></span>
</label>
@MM-coder
MM-coder / index.html
Created March 16, 2019 08:47
My 404 page
<div class="code-area">
<span style="color: #777;font-style:italic;">
// 404 page not found.
</span>
<span>
<span style="color:#d65562;">
if
</span>
(<span style="color:#4ca8ef;">!</span><span style="font-style: italic;color:#bdbdbd;">found</span>)
{
counter = 100 # A number
miles = 1000.0 # A floating point
name = "John" # A string (text)