Skip to content

Instantly share code, notes, and snippets.

View TRSGuy's full-sized avatar

Kim TRSGuy

  • Stockholm, Sweden
View GitHub Profile
#Imports
import socket
import sys
import sched, time
import re
#Globals
server = "chat.freenode.net" #The irc server that you want the bot to connect to.
channel = "##kanal56" #The channel you want the bot to join on start
botnick = "vorabot" #The bot's IRC Nick
import socket, threading
class irc(object):
def __init__(self, nick):
super(irc, self).__init__()
self.s = socket.socket()
self.nick = nick
self.channel = '##tinyvoxel'
self.server = 'irc.freenode.net'
self.oauth = 'ThisIsAPassIPromise'
self.main()
import glob, praw, requests, subprocess
from pathlib import Path
SUBREDDIT = "wallpapers"
wallpaperPath = "{}/Wallpapers/".format(str(Path.home()))
files = [i.split("/")[-1] for i in glob.glob(wallpaperPath+"*")]
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 and not post.url.split("/")[-1] in files]
import praw, subprocess, pathlib
SUBREDDIT = "wallpapers"
pp = "{}/.prevwall".format(str(pathlib.Path.home())) # this is where the previously used wallpaper links are stored
previousImages = [] # This is where the urls of previously used images will be stored
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(limit=5) if post.url.split(".")[-1] in allowedFormats and !(in previousImages)post.url]
* {
background-color: rgba(200, 200, 200, 0.20);
text-color: #000;
}
#element selected {
background-color: #222;
text-color: #C8C8C8;
}
#listview {
spacing: 0;
PROMPT="%{$fg[green]%}%~ %{$fg[cyan]%}%% %{$reset_color%}"
RPROMPT="%{$fg[green]%}[%n%{$reset_color%}@%{$fg[cyan]%}%m]%{$reset_color%}"
#!/bin/sh
color() {
echo -n "%{F#222}"
}
nocolor() {
echo -n "%{F#000}"
}
host_is_up() {
if ping -c 1 $1 &> /dev/null
then