Skip to content

Instantly share code, notes, and snippets.

View timothycarambat's full-sized avatar

Timothy Carambat timothycarambat

View GitHub Profile
@timothycarambat
timothycarambat / reddit_mod_scrape
Last active May 7, 2019 03:50
Reddit Moderator Comment Analysis for u/kenotism for thesis project! https://www.reddit.com/r/programmingrequests/comments/bkdjcf/reddit_web_scraping/
import csv, json, os
from datetime import datetime
import praw
def get_reddit():
return praw.Reddit(client_id='',
client_secret = '',
user_agent='Praw')
def get_mod_data():
@timothycarambat
timothycarambat / nametag_solver.py
Last active May 3, 2019 07:45
Simple Script for Madi that assembles MCA nametags that are needed from a HUGE SLOW online system that takes forever to transcribe from the system to an email.
import os, csv, re
PATH = "SOME/ABS/PATH"
#remove old output files
def cleanup():
for file_name in os.listdir(PATH):
if '.txt' in file_name:
os.remove(file_name)
Public Function TINYURL_GENERATOR(base_url As String) As String
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Top = 0
objIE.Left = 0
objIE.Width = 800
objIE.Height = 600
objIE.Visible = False
@timothycarambat
timothycarambat / config_maker.sh
Created February 11, 2019 01:28
File that takes in a file of IP addresses with CIDR blocks. It then creates a new config file based on the specification. For r/programming_request https://www.reddit.com/r/programmingrequests/comments/aorj14/script_to_enter_contents_of_text_file_into/
#!/usr/bin/env bash
# This file takes in one argument (the absolute path of the generate NETFLIX file with IPs)
filename=$1
if [ -z $filename ]
then
echo "No Filename specified! Exited."
exit
fi
@timothycarambat
timothycarambat / overwrite_gifs.py
Last active February 6, 2019 03:52
In an S3 bucket, take all gifs and overwrite them with a single frame of the same gif.
import boto3
import random
from PIL import Image
s3 = boto3.resource('s3')
bucket_name = "my-bucket"
bucket = s3.Bucket(bucket_name)
exception_file_name = "images/7df7a570-2348-11e9-8b57-e3db97667bbd.gif"
files_to_remove = []
@timothycarambat
timothycarambat / word_count.pyw
Created February 5, 2019 06:19
Python GUI Directory Monitor that automatically gets the word count across all DOCX files in a directory! /r/programming request for /u/punter45 LINK:https://www.reddit.com/r/programmingrequests/comments/amuwfe/request_microsoft_word_word_count_tracker/
from docx import Document
from Tkinter import *
import os
def get_documents(files):
file_list = []
for document in files:
if ".docx" in document and "$" not in document:
# You should have a .txt file named users.txt in the same directory you run this script in.
# You will need to have install beautifulsoup4 as well as rquest
from bs4 import BeautifulSoup as bs
import requests
import csv
twitter_ids = []
twitter_handles = {}
#!/bin/bash
#This file will take two inputs. One origin directory with N subfolders
#Another Directory which to post the Copied files to
#a Count as a number
#Will output in Target Directory a random selection of files.
#you may have to give permissions to this file to work via `chmod 755 randomizer.sh`
#You can execute the script by ./randomizer.sh '/home/me/Desktop/Files' '/home/me/Desktop/Destination' 5 2>/dev/null
#You will see some printed output. You can open the directory and the files will be present.
#If you specifiy a higher count than files that exist you will have to force kill the script.
body {
background-color: #0e0e0e;
}
.content {
background-color: #1d1c1c;
}
.indextab > li.active > a{
background-color: #8c8a8a !important;
}
.indextab > li > a:hover {
@timothycarambat
timothycarambat / data.txt
Created September 19, 2018 04:09
u/BeginningAlternative Data Parser in Python
bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla - last name, first name day time (activity 1; activity 2)bla bla bla bla and more bla bla -