Skip to content

Instantly share code, notes, and snippets.

@JakenHerman
JakenHerman / cigar_party.py
Created February 13, 2014 17:23
cigar_party in Coding Bat
__author__ = 'Jaken'
def cigar_party(cigars, is_weekend):
if is_weekend and cigars >= 40:
return True
elif is_weekend and cigars < 40:
return False
elif not is_weekend and cigars < 40 and cigars > 60:
return False
@JakenHerman
JakenHerman / alarm_clock.py
Created February 13, 2014 19:08
alarm_clock on Coding Bat
__author__ = 'Jaken'
def alarm_clock(day, vacation):
if not vacation and day >=1 and day <=5:
return "7:00"
elif (not vacation) and (day == 0 or day == 6):
return "10:00"
elif vacation and day == 0 or day ==6:
return "off"
elif vacation and day >=1 and day <=5:
@JakenHerman
JakenHerman / squirrel_play.py
Created February 13, 2014 17:57
squirrel_play on Coding Bat
__author__ = 'Jaken'
def squirrel_play(temp, is_summer):
if is_summer and temp >= 60 and temp <=100:
return True
elif not is_summer and temp >= 60 and temp <= 90:
return True
else:
return False
name: Work Stats Readme
on:
workflow_dispatch:
schedule:
# Runs every 2 hours
- cron: "0 */2 * * *"
jobs:
update-readme:
name: Run bot
on:
workflow_dispatch:
schedule:
# Runs every 2 hours
- cron: "0 */2 * * *"
jobs:
prep:
import os
import praw
from supabase_py import create_client, Client
reddit = praw.Reddit(
username = os.environ.get('REDDIT_USERNAME'),
password = os.environ.get('REDDIT_PASSWORD'),
client_id = os.environ.get('API_CLIENT'),
client_secret = os.environ.get('API_SECRET'),
user_agent = "Scooby Searcher Bot"
import os
import praw
from supabase_py import create_client, Client
reddit = praw.Reddit(
username = os.environ.get('REDDIT_USERNAME'),
password = os.environ.get('REDDIT_PASSWORD'),
client_id = os.environ.get('API_CLIENT'),
client_secret = os.environ.get('API_SECRET'),
user_agent = "Scooby Searcher Bot"
import os
import praw
reddit = praw.Reddit(
username = os.environ.get('REDDIT_USERNAME'),
password = os.environ.get('REDDIT_PASSWORD'),
client_id = os.environ.get('API_CLIENT'),
client_secret = os.environ.get('API_SECRET'),
user_agent = "Scooby Searcher Bot"
)
API_CLIENT=<YOUR_API_CLIENT>
API_SECRET=<YOUR_API_SECRET>
REDDIT_USERNAME=<YOUR_REDDIT_USERNAME>
REDDIT_PASSWORD=<YOUR_REDDIT_PASSWORD>
SUPABASE_KEY=<YOUR_SUPABASE_KEY>
SUPABASE_URL=<YOUR_SUPABASE_URL>
import os
import praw
from supabase_py import create_client, Client
reddit = praw.Reddit(
username = os.environ.get('REDDIT_USERNAME'),
password = os.environ.get('REDDIT_PASSWORD'),
client_id = os.environ.get('API_CLIENT'),
client_secret = os.environ.get('API_SECRET'),
user_agent = "Scooby Searcher Bot"