Jake.codes

Quick Feed

Friday, March 18, 2016

Roll your own feed RSS from a website.

Getting Started

  1. Install the required packages npm i
  2. Edit the config.js
  3. Run it! npm start

Config

You can set all this in the config.js file.

Gif Library

Sunday, July 05, 2015

PHP Apache Directory Index for Gifs

Original directory grabbing and outputting by someone else. I wish I could remember so I could cite it.

Demo

You can see my Gif Library at MyHot.Pics

Setup

To customize this library for you, you will need to set the $libraryUrl variable in .index.php to your website’s URL. Optionally, you can set the name of your library ($libraryName) and the default search box text ($librarySearchText).

Usage

The gifs folder has a bunch of .files so the folder appears empty. Place this directory in an Apache server and it’ll take over the directory listing. Drop in some gifs and you got yourself a Gif Management System. Look at you, gif-ing things done.

Parameters

Example: /?format=html&limit=100&offset=0&q=Adventure+Time

On NSFW Gifs

By default I have it set up that if a gif filename contains NSFW, it will not show up on the main page of the website. If you want NSFW gifs, you will need to search for it.

Integrations

PlexLog

Tuesday, February 24, 2015

Creates a CSV log of what people are watching on your Plex.

Usage

Set up using cron or launchd to run every 10 minutes.

Config

In the top of plexlog.py you can set the three configuration options.

Data

Minimal data collected, just the who, what, when, where. Um, I mean when, who, where, what. All this stored in a simple CSV file.

PlexStats

A quick way of parsing all that CSV data to generate a Markdown formatted analytics. Set your plexlog.csv path in the header of plexstats.py and run it to get a simple bulleted list of all the stats.

WhatIsThat.py

Thursday, February 19, 2015

This is a super simple regular expressions test to see if I could safely indentify text as either:

  1. a calendar event
  2. an email address
  3. a url
  4. an location
  5. a phone number

Once I have indentified it, I can then act upon it. I wrote this up in Python and Regex so I can make a little clipboard monitoring script on my iPhone. For example, if I have an address in my clipboard, I probably want directions on how to get there. If I have something with a date or time, I probably need to schedule it in my calendar. I’m still working on that part, but I feel like this is a handy starting point.

import re

query = "My Query Here"

regexes = [
    (
        'datetime',
        '((\d\d?:\d\d|\d+(a|p)m?)|\d{2,4}[- /.]\d{2}[- /.]\d{2,4}|(January|Jan|February|Feb|March|Mar|April|Apr|May|June|Jun|July|Jul|August|Aug|September|Sep|Sept|October|Oct|November|Nov|December|Dec|\d\d?) \d+(st|th|rd)?)'
    ),
    (
        'email',
        '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}'
    ),
    (
        'url',
        '(\w+://(\w+)?|\d+\.\d+\.\d+\.\d+|\w+\.\w+)'
    ),
    (
        'location',
        '(Avenue|AVE|Boulevard|BLVD|Circle|CIR|Court|CT|Drive|DR|Freeway|FRWY|Highway|HWY|Lane|LN|Mews|Parkway|PKWY|Pike|Road|RD|Street|ST|Trail|TRL|Way|Alabama|AL|Montana|MT|Alaska|AK|Nebraska|NE|Arizona|AZ|Nevada|NV|Arkansas|AR|New Hampshire|NH|California|CA|New Jersey|NJ|Colorado|CO|New Mexico|NM|Connecticut|CT|New York|NY|Delaware|DE|North Carolina|NC|Florida|FL|North Dakota|ND|Georgia|GA|Ohio|OH|Hawaii|HI|Oklahoma|OK|Idaho|ID|Oregon|OR|Illinois|IL|Pennsylvania|PA|Indiana|IN|Rhode Island|RI|Iowa|IA|South Carolina|SC|Kansas|KS|South Dakota|SD|Kentucky|KY|Tennessee|TN|Louisiana|LA|Texas|TX|Maine|ME|Utah|UT|Maryland|MD|Vermont|VT|Massachusetts|MA|Virginia|VA|Michigan|MI|Washington|WA|Minnesota|MN|West Virginia|WV|Mississippi|MS|Wisconsin|WI|Missouri|MO|Wyoming|WY)'
    ),
    (
        'phone',
        '[0-9-,p\*\#]{5,}'
    ),
    (
        'unidentified',
        '.+'
    )
]

for type, regex in regexes:
    if re.search(regex, query, re.I | re.M) is None:
        continue
    else:
        print "%s: %s" % (type, query)
        break

Quartz Composer Expirements

Thursday, February 19, 2015

These are fun little Quartz Composer screen saver expirements. No one makes screen savers anymore, but in the workplace they come in handy for fun social expirements. Whoops! I mean, they come in handy for ways of blanking your screen.

How to Install

Take the .qtz file and drop it in ~/Library/Screen Savers/

Head Tracking

These screen savers use your camera to track heads.

Adventure Time

Replaces faces with a mask of Finn the Human, Jake the Dog, and BMO the football.

Download Adventure Time Mask Screen Saver

Bob’s Burgers

Replaces faces with a mask of Tina Belcher, Louise Belcher, and Bob Belcher.

Download Bob’s Burgers Mask Screen Saver

LOST Clock

Turn your desk in to a real life Swan Dharma station. This is sure to make all your coworkers who don’t remember LOST suspcious. Prepare to have security ask you about the potential magnetic bomb scare.

Download LOST Clock Screen Saver

FeedFB, RSS for Eating at Facebook

Friday, December 05, 2014

What is being served by the Facebook Culinary Team? Now you’ll know. This is a simple RSS feed with a built in filtering system.

Usage

Example Usage

Integrations

These RSS feeds are great in combination with your RSS reader of choice, Safari sidebar, and IFTTT.

FeededTweets, Twitter in your RSS Reader

Friday, December 05, 2014

Keep up with your Twitter stream by putting it in your RSS reader. Incredibly simple, incredible useful. You can get just the links or just your mentions. Oh, and it supports inline photos and regex filtering. Regex filtering? Yes, you heard me.

Oh, and you probably don’t want to put this where people can stumble upon it.

Usage

Setup

  1. Create a new Twitter app (make it read-only)
  2. On the Keys and Access Tokens, geneate your access token.
  3. Put all the tokens and secrets in feededtweets.rb
  4. Configure all the things you want to configure in feededtweets.rb

Now you want to put this someplace where it is always running. Here’s how you would deploy to Heroku.

  1. Save your configuration: git add . && git commit -m "I configured stuff"
  2. Install the gems: bundle install
  3. Create a Heroku app: heroku apps:create APP-NAME-HERE
  4. Push it to Heroku: git push heroku master