Week's Win Achievements: Personal Triumphs and Tech Innovations
Celebrating small wins is one of the best ways to stay motivatedโespecially in tech, where progress can feel slow. In this article, Iโll walk you through real, beginner-friendly wins from my past week, both personal and technical. Each win includes step-by-step code examples, practical tips, and how you can apply them to your own journey.
Letโs dive in.
๐ฏ Win #1: Automated My Morning Routine with Python
Problem: I kept forgetting to check the weather and my calendar before starting work.
Solution: I built a simple Python script that runs at startup and tells me the weather, upcoming events, and motivational quote.
Step 1: Install Required Libraries
pip install requests google-api-python-client google-auth-httplib2 google-auth-oauthlib
Step 2: Get Weather Using OpenWeatherMap API
import requests
def get_weather(city="London"):
API_KEY = "your_openweather_api_key"
url = f"http://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}&units=metric"
response = requests.get(url)
data = response.json()
temp = data['main']['temp']
description = data['weather'][0]['description']
return f"๐ค๏ธ {temp}ยฐC, {description}"
print(get_weather("San Francisco"))
๐ Get your free API key at openweathermap.org
Step 3: Fetch Google Calendar Events
Set up Google Calendar API (follow quickstart guide).
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
import datetime
SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']
def get_calendar_events():
creds = None
if os.path.exists('token.json'):
creds = Credentials.from_authorized_user_file('token.json', SCOPES)
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file('credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
with open('token.json', 'w') as token:
token.write(creds.to_json())
service = build('calendar', 'v3', credentials=creds)
now = datetime.datetime.utcnow().isoformat() + 'Z'
events_result = service.events().list(calendarId='primary', timeMin=now,
maxResults=5, singleEvents=True,
orderBy='startTime').execute()
events = events_result.get('items', [])
if not events:
return "โ
No upcoming events"
return "๐
" + ", ".join([event['summary'] for event in events[:3]])
Step 4: Combine and Run
import random
quotes = [
"Code every day. Even if it's just 10 lines.",
"Progress > perfection.",
"You're closer than you were yesterday."
]
def morning_brief():
print("๐ Good morning!")
print(get_weather("Austin"))
print(get_calendar_events())
print("๐ฌ", random.choice(quotes))
if __name__ == "__main__":
morning_brief()
โ Win: Runs on startup via cron (Linux/Mac) or Task Scheduler (Windows). Saves me 5 minutes daily.
๐ฏ Win #2: Fixed a Bug That Took Me 3 Days (Spoiler: It Was a Typo)
Problem: My Flask app kept returning 500 Internal Server Error on login.
@app.route('/login', methods=['POST'])
def login():
username = request.form['username']
password = request.form['password']
# BUG: Used '==' instead of '=' in assignment
user == User.query.filter_by(username=username).first() # โ
if user and check_password(user.password, password):
return redirect('/dashboard')
return "Invalid credentials"
Debugging Steps:
- Added logging:
import logging
logging.basicConfig(level=logging.DEBUG)
- Used
print()to trace:
print("Username:", username) # Confirmed input was correct
- Checked traceback:
UnboundLocalError: local variable 'user' referenced before assignment
Fix: Simple typo โ changed == to =.
user = User.query.filter_by(username=username).first() # โ
๐ก Lesson: Always use linters (pylint, flake8) and enable debug mode:
app.run(debug=True)
๐ฏ Win #3: Built a GitHub Stats Card for My Profile
I wanted to show my coding activity on my GitHub profile README.
Step 1: Create README.md in Your Profile Repo
Make a repo named yourusername/yourusername (e.g., johndoe/johndoe).
Step 2: Use GitHub Readme Stats
Add this to your README.md:
markdown
[](https://github.com/anuraghazra/github-readme-stats)
[
---
โ **Professional**
Top comments (0)