Skip to content

Instantly share code, notes, and snippets.

View kjaymiller's full-sized avatar
🤔

Jay Miller kjaymiller

🤔
View GitHub Profile
@kjaymiller
kjaymiller / gchrome draft
Last active August 29, 2015 14:17
Drafts 4 Open Link in Google Chrome
/*This script allows me to paste URL's into drafts to look at later in google chrome
This removes the "format://" from the URL */
var x = draft.content
x = x.split("//") //The actual separation returns {format:,url}
draft.defineTag("split",x[1]) //enables the url to be added to url code
/*The Following is entered into a URL Action
@kjaymiller
kjaymiller / trello_doc.py
Created October 14, 2015 14:44
Takes the exported JSON
import json
with open('9E2fnCy5.json', 'r+') as f:
board = json.loads(f.read())
def trello_attrs():
print('Board Keys \n {} \n'.format(board.keys()))
print('Card Keys \n {} \n'.format(board['cards'][0].keys()))
"""
Takes files in a directory and strips out the html
created: 20160503
by: Kevin 'Jay' Miller
kjaymiller@gmail.com
Place this
"""
from os import listdir
@kjaymiller
kjaymiller / make_schedule.py
Last active September 10, 2016 19:20
Make Schedule
"""
Make Schedule converts a list of items into a schedule to repeat on the same day.
I use this to get an idea of when my episodes are airing and to know what promotions to use when.
"""
from datetime import datetime, timedelta
def make_schedule(episodes,
release_day,
date_start=datetime.today(),
@kjaymiller
kjaymiller / zip_to_state_top_5.py
Last active December 8, 2016 18:01
List the Top 5 States in a csv from Zip_Codes
import csv
import json
from sys import argv
import requests
base_request = 'http://api.zippopotam.us/us/'
# import the zip codes you will be looking for
with open(argv[1], 'r') as f:
reader = csv.reader(f)
@kjaymiller
kjaymiller / .gitignore
Last active February 9, 2017 03:19
Get the Last 6 days worth of Reddit Posts
secrets.py
*.md
__pycache__/
bin/
lib/
pip-selfcheck.json
pyvenv.cfg
@kjaymiller
kjaymiller / cough-button.applescript
Created June 11, 2017 13:48
software cough-button (The AppleScript Way)
(* This AppleScript was inspired by another script I found on the internet. I'm sorry I don't have the original link.
This works really well with BetterTouch Tool or Keyboard Maestro.
DOWNSIDE: I have noticed about a 1/2 millisecond lag to this script. It could be my hardware or just the latency of running it through another tool.
*)
if input volume of (get volume settings) = 0 then
set level to 100
else
set level to 0
@kjaymiller
kjaymiller / Tweet Stormer.js
Last active August 16, 2017 18:23
Tweet Stormer created by kjaymiller - https://repl.it/KMRm/4
var text = prompt("Enter Your Tweet");
var txt_split = text.match(/\(?[^\.\?\!]+[\.!\?]\)?/g);
txt_split = txt_split.map((e) => e.trim());
txt_split;
var final_tweets = [''];
for (i = 0, a = 0; a < txt_split.length;) {
if (txt_split[a].length + final_tweets[i].length < 135) {
final_tweets[i] = final_tweets[i] + txt_split[a];
a++
}
@kjaymiller
kjaymiller / Itunes.scptd
Last active December 31, 2017 17:27
Get YouTube Tab Title from Safari
app = Application('Itunes');
app.currentTrack.name() + ' by ' + app.currentTrack.artist()
@kjaymiller
kjaymiller / text_to_things3.scptd
Last active October 7, 2021 22:24
AppleScript Import Text to Things3
on run {input, parameters}
set delimitedList to paragraphs of (input as string)
tell application "Things3"
repeat with currentTodo in reverse of delimitedList
set newToDo to make new to do with properties {name:currentTodo} at beginning of list "Inbox"
end repeat
end tell
end run