Skip to content

Instantly share code, notes, and snippets.

View cpebble's full-sized avatar
👨‍🎓
Back at uni again(again)

Christian Påbøl Jacobsen cpebble

👨‍🎓
Back at uni again(again)
View GitHub Profile
@cpebble
cpebble / fzbz.js
Last active September 17, 2020 13:31 — forked from chregon/fzbz.js
Fizzbuzz but can i do FP? no u
function iota (n) { // Pretty genius implementation
return [...Array(n).keys()]
}
function fizzbuzz (n) {
return iota(30).map( x =>
(x % 15 === 0 ? "fizzbuzz" : x % 3 == 0 ? "fizz" : x % 5 == 0 ? "buzz" : x.toString())
)
}
import praw, subprocess
SUBREDDIT = "wallpapers"
r = praw.Reddit(client_id="",
client_secret="",
user_agent="WallpaperGrabber by /u/ParanoidBox")
allowedFormats = ['jpg', 'png']
urls = [post.url for post in r.subreddit(SUBREDDIT).hot() if post.url.split(".")[-1] in allowedFormats]
subprocess.call(['feh', "--bg-fill", urls[0])