Skip to content

Instantly share code, notes, and snippets.

#Luke , Python , 9/17/2014
month = raw_input("Month: ").lower()
year = int(raw_input("Year: "))
month30 = ["september", "april", "june", "november"]
month31 = ["january", "march"]
month29 = ["february"]
if month in month30:
print "Which is better? Coke Zero or Water?"
answer1 = raw_input("Answer: ").lower()
if answer1 == "coke zero":
print "Correct!"
else:
print "Wrong!"
print "Does Luke like climbing?"
answer2 = raw_input("Answer: ").lower()
if answer2 == "yes":
x = 0
print "Which is better? Coke Zero or Water?"
answer1 = raw_input("Answer: ").lower()
if answer1 == "coke zero":
print "Correct!"
x += 1
else:
print "Wrong!"
#Luke , Python , 9/17/2014
month = raw_input("Month: ").lower() # asks what month it is and forces the entry to be in lower case so that it matches with my list entries
# when you put things in "" it makes it print
year = int(raw_input("Year: ")) # asks for year and the int() requires the entry to be a number
month30 = ["september", "april", "june", "november"] # all the months with 30 days
month31 = ["january", "march", "may", "july", "august", "october", "december"] # all months with 31 days
month29 = ["february"] #month with 28 /w no leap and 29 with leap
# elif means "else if"
@LewkyB
LewkyB / gist:56cdb68ad75345d40f64a64ea5c95482
Created May 23, 2020 04:23
AHK script for RAlt + t will create a new text file in file explorer focus
; create new text file in current window focus
#IfWinActive ahk_class CabinetWClass
>!t:: ;explorer - create new text file and focus/select it
#IfWinActive ahk_class ExploreWClass
>!t:: ;explorer - create new text file and focus/select it
;note: similar to: right-click, New, Text Document
vNameNoExt := "New Text Document"
vDotExt := ".txt"
WinGet, hWnd, ID, A
for oWin in ComObjCreate("Shell.Application").Windows
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
// used to allow for window resizing
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow* window);
const char* vertex_shader_source = "#version 330 core\n"
@LewkyB
LewkyB / playback_device_switcher.ahk
Created July 1, 2020 18:11
right alt + F1 - headphones // right alt + F2 - speakers (you can add more devices)
; PURPOSE: Use hotkeys to switch between audio devices
; source: https://www.autohotkey.com/boards/viewtopic.php?t=49980
Devices := {}
IMMDeviceEnumerator := ComObjCreate("{BCDE0395-E52F-467C-8E3D-C4579291692E}", "{A95664D2-9614-4F35-A746-DE8DB63617E6}")
; IMMDeviceEnumerator::EnumAudioEndpoints
; eRender = 0, eCapture, eAll
; 0x1 = DEVICE_STATE_ACTIVE
@LewkyB
LewkyB / oven_thermometer.cpp
Created April 20, 2021 21:18
oven thermometer that connects to wifi and communicates temp to message broker. can also receive messages from broker
/*
oven thermometer with MQTT
based on:
- https://github.com/pawl/oven_thermometer
- https://simple-circuit.com/esp8266-nodemcu-ili9341-tft-display/
- https://randomnerdtutorials.com/esp32-mqtt-publish-subscribe-arduino-ide/
parts:
- 2.8in SPI TFT ILI9341 screen
- MAX6675 temperature sensor
- k-type thermocouple
@LewkyB
LewkyB / pre-commit_generated_script.sh
Created May 1, 2021 17:47
shell script example generated by pre-commit
#!/usr/bin/env python3
# File generated by pre-commit: https://pre-commit.com
# ID: unique_id
import os
import sys
# we try our best, but the shebang of this script is difficult to determine:
# - macos doesn't ship with python3
# - windows executables are almost always `python.exe`
# therefore we continue to support python2 for this small script
version: '3'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/raspberrypi4-homeassistant:stable"
volumes:
- /home/pi/home_assistant/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped