Skip to content

Instantly share code, notes, and snippets.

View PythonCoderAS's full-sized avatar

PythonCoderAS PythonCoderAS

  • New York City
  • 18:41 (UTC -04:00)
View GitHub Profile
@PythonCoderAS
PythonCoderAS / Services In HTML.ps1
Created November 17, 2016 00:55
Services In HTML
$a = "<style>"
$a = $a + "BODY{background-color:peachpuff;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}"
$a = $a + "strong{color: green;}"
$a = $a + "</style>"
$b = "<H2>Service Information</H2>"
@PythonCoderAS
PythonCoderAS / InstallRedditApps.bat
Created December 6, 2016 01:06
Install the Python Reddit Modules
powershell -Command MKDIR "C:\Users\$env:USERNAME\Desktop\InstallLogs"
python -m pip install --upgrade praw -v -v -v>.\InstallLogs\praw.log
python -m pip install --upgrade praw-oauth2util -v -v -v>.\InstallLogs\praw-oauth2util.log
python -m pip install --upgrade beautifulsoup4 -v -v -v>.\InstallLogs\beautifulsoup4.log
Version 3.5.0 of praw is outdated. Version 4.0.0 was released 6 days ago.
nottheonion not nsfw
AutoModerator not nsfw
needamod not nsfw
Already know it's SFW (AutoModerator)
Already know it's SFW (AutoModerator)
Already know it's SFW (AutoModerator)
Already know it's SFW (AutoModerator)
RequestABot not nsfw
Already know it's SFW (RequestABot)
import praw
r=praw.Reddit(user_agent="oetuwoiut423oiut34oi2jtn432oijntoiut42oiu/0.1")
user_name='user'
r.login(user_name,'pass',disable_warning=True)
session = r.get_redditor(user_name)
comments = session.get_comments(limit=1000)
@PythonCoderAS
PythonCoderAS / Reddit.xml
Created December 8, 2016 00:08
A Reddit XML file
<xml class=reddit-user-info status=Public>
<xml-info>
<date>MM-D-YYYY</date>
<timezone>UTC</timezone>
</xml-info>
<user-info>
<username>USERNAME</username>
<karma>
<postkarma>postkarma</postkarma>
<commentkarma>commentkarma</commentkarma>
<reddit-user-info status="public" date="YYYY-MM-DD" timezone="UTC" username="USERNAME">
<karma posts="postkarma" comments="commentkarma" total="totalkarma"/>
<subreddit-catalog>
<subreddit name="name" status="status" link="https://www.reddit.com/r/Example/">
<modstatus permissions="none"/>
</subreddit>
<!-- A typical new user might visit around 10-20 subs. A typical old user would have visited around 50-70 subs. -->
<!-- A typical mod might mod 1-5 subs. Older mods might mod 5-10 subs. Experinced modders might mod 10-20 subs. AutoMod mods every single subreddit.-->
</subreddit-catalog>
</reddit-user-info>
@PythonCoderAS
PythonCoderAS / delete.py
Last active September 21, 2017 17:15
Easy way to delete posts by your bot
import praw
u = ''
p = ''
c_id = ''
c_secret = ''
reddit = praw.Reddit(username = u, password = p, client_id = c_id, cient_secret = c_secret)
import praw
import datetime
import time
import prawcore
u = '' #username
p = '' #password
c_id = '' #client_id
c_s = '' #client secret
@PythonCoderAS
PythonCoderAS / primes.py
Created May 5, 2018 01:47
Easy way to find (and gen) prime numbers
def is_prime(n):
if n == 2 or n == 3: return True
if n < 2 or n%2 == 0: return False
if n < 9: return True
if n%3 == 0: return False
r = int(n**0.5)
f = 5
while f <= r:
if n%f == 0: return False
if n%(f+2) == 0: return False
<?xml version="1.0" encoding="UTF-8"?>
<filesystem>
<drive letter='C' total_space = '500G' used_space = '250G' free_space = '250G' />
<folder name = 'C:\' used_space = '250000M' path = 'C:\'>
<file name = 'testfile.txt' extension = '.txt' space = '100B' path = 'C:\testfile.txt' />
<file name = 'testfile2.txt' extension = '.txt' space = '1000B' path = 'C:\testfile2.txt' />
<file name = 'testfile3.txt' extension = '.txt' space = '500B' path = 'C:\testfile3.txt' />
<folder name = 'Program Files' used_space = '15000M' path = 'C:\Program Files'>
<file />
(etc.)