Skip to content

Instantly share code, notes, and snippets.

View turnipsoup's full-sized avatar
🍎
Getting healthier

Jeremy Heckt turnipsoup

🍎
Getting healthier
View GitHub Profile
@turnipsoup
turnipsoup / index.html
Created April 23, 2018 15:53
phone-number-cleaner
<head>
<title>Phone Number Cleaner</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<div class='main-holder text-center'>
@turnipsoup
turnipsoup / git.py
Created May 17, 2018 22:05
auto git stuff
#!/usr/bin/python3
#
from sys import argv
import subprocess
try:
fileName = argv[0]
firstArg = argv[1]
secondArg = argv[2]
@turnipsoup
turnipsoup / craigslist_tracker.js
Created May 25, 2018 01:00
Used to pull the cragslist posting on a given URL
var cheerio = require("cheerio");
var request = require('request');
request("https://seattle.craigslist.org/d/science-biotech/search/sci", function (error, response, html) {
if (!error) {
var $ = cheerio.load(html)
$("li.result-row").each(function (i, element) {
var obj = {}
var b = $(this)
obj["title"] = b.children().children().text()
# coding: utf-8
# In[5]:
import requests # Requesting HTML
import bs4 as bs # Parsing HTML
import json
import time
@turnipsoup
turnipsoup / lofi.py
Last active June 8, 2019 04:09
Gets lofi tracks from reddit and makes a list for you.
#!/usr/bin/env python3
#
import requests
import json
import subprocess
import datetime
currdate = datetime.datetime.now()
@turnipsoup
turnipsoup / log_cat.sh
Created July 4, 2019 06:25
Create pipe delineated output file of all .log files in a directory, including file name on each line
#!/bin/bash
#
for filename in ./*.log; do
while read line; do
echo "$filename|$line" >> output.txt
done < ./$filename
done
@turnipsoup
turnipsoup / iterm2colorsget.py
Created September 3, 2019 03:03
Download all iterm2colors from the website https://iterm2colorschemes.com/
import bs4 as bs
import requests
r = requests.get("https://iterm2colorschemes.com/")
soup = bs.BeautifulSoup(r.content, "lxml")
for theme in soup.find_all("a", href=True):
if "raw.githubusercontent" in theme['href']:
file_name = theme.text.replace(" ","") + ".itermcolors"
@turnipsoup
turnipsoup / unique_id.py
Created September 11, 2019 04:03
Makes an ID. Don't want to have to type the characters again.
def uniqIdenGen():
char_options = [
"A","B","C","D","E","F","G","H","I","J",
"K","L","M","N","O","P","Q","R","S","T",
"U","V","W","X","Y","Z",
"1","2","3","4","5","6","7","8","9","0"
]
returned_id = []
@turnipsoup
turnipsoup / tasteOfHomeGet.py
Last active January 18, 2020 01:30
Get all publicly available recipes from tasteofhome.com and compiles them into a TSV file. Includes nutrition facts.
import requests as r
import bs4 as bs
import json
# Configuration
input_list = "tasteOfHome.csv"
base_url = "https://www.tasteofhome.com/recipes/page/"
site = 'https://www.tasteofhome.com'
output_filename = "tasteOfHome.csv" # URL csv for getRecipesList()
final_filename = "tasteOfHomeRecipes.tsv" # Recipe tsv output for tasteOfHomeCsvMake()
@turnipsoup
turnipsoup / chartmake.py
Last active January 28, 2020 17:03
A thin wrapper to make Seaborn charts from the command line.
#!/usr/bin/env python3
#
# Here we parse the arguments and check their validity BEFORE importing the heavy libraries, just in case. Saves CPU.
# Arguments parsing
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-f", help="File name")
parser.add_argument("-c", help="Chart type. To view list of support charts, use --charts")