Skip to content

Instantly share code, notes, and snippets.

View prokizzle's full-sized avatar
🌮
IT'S TACO TIME!

Nick Prokesch prokizzle

🌮
IT'S TACO TIME!
View GitHub Profile
@prokizzle
prokizzle / itunes-toggle-up-next.scpt
Created November 30, 2012 19:36
Toggle iTunes Up Next - LaunchBar Action
tell application "iTunes" to activate
try
menu_click({"iTunes", "View", "Show Up Next"})
on error
menu_click({"iTunes", "View", "Hide Up Next"})
end try
-- `menu_click`, by Jacob Rus, September 2006
--
-- Accepts a list of form: `{"Finder", "View", "Arrange By", "Date"}`
-- Execute the specified menu item. In this case, assuming the Finder
@prokizzle
prokizzle / duration.py
Created May 26, 2014 16:34
Pythonista - Driving Duration Calculator
import urllib2
import urllib
import json
import webbrowser
import sys
origin = "78704"
destination = urllib.quote(sys.argv[1],'')
@prokizzle
prokizzle / cover.css
Created May 26, 2014 16:39
Pythonista - Quick Driving Duration Calculator
/*
* Globals
*/
/* Links */
a,
a:focus,
a:hover {
color: #fff;
}
@prokizzle
prokizzle / robots.rb
Last active August 29, 2015 14:02
80legs_Robots_Parser
# 80legs Bulk Robots Checker
# 80legs.com 2014
# Usage: ruby robots.rb <path_to_url_list>
# Example: $> ruby robots.rb /Users/nick/Documents/url_list_1.txt
#
# Installation/Requirements:
# gem install rest-client
#
class RobotsParser
require 'json'
@prokizzle
prokizzle / crawlable.rb
Last active August 29, 2015 14:02
80legs URL Crawlability Validator
# 80legs Bulk Robots Checker
# 80legs.com 2014
# Usage: ruby crawlable.rb <path_to_url_list>
# Example: $> ruby crawlable.rb /Users/nick/Documents/url_list_1.txt > output.csv
# #=> creates a CSV file containing each url, and whether or not it's crawlable
#
# Installation/Requirements:
# gem install robotstxt
#
class String
@prokizzle
prokizzle / authenticated_scraper.rb
Created October 24, 2014 16:09
Serialize authenticated Mechanize sessions in Ruby
class AuthenticatedScraper
def initialize(args)
if args[:session]
@cookie_jar = args[:session]
@agent = Mechanize.new
@agent.cookie_jar = load_session(@cookie_jar)
else
@agent = Mechanize.new
@agent.login(args[:username], args[ password])
end
@prokizzle
prokizzle / Gemfile
Last active August 29, 2015 14:11
Sit or Stand Timer
gem 'timers'
gem 'terminal-notifier'
gem 'daemons'
@prokizzle
prokizzle / account.rb
Created February 7, 2015 10:59
Redis Hash Example in Rails
class Account
def self.name(id)
account = $redis.hget("accounts", id)
if account.nil?
account = User.find_by(id: id).settings(:personal).account
$redis.hset("accounts", id, account)
end
return account
end
end
@prokizzle
prokizzle / default.conf
Last active March 28, 2023 02:10
Working Nginx Config for Faye over SSL
upstream faye_server {
server 127.0.0.1:9292;
}
server {
# listen 80;
listen 443 ssl;
server_name your-faye-server.com;
@prokizzle
prokizzle / langoliers.rb
Last active August 29, 2015 14:15 — forked from robinsloan/langoliers.rb
Delete old tweets
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/Users/your_name/Dropbox/backup/tweets/" # you need to create this folder
TWITTER_USER = "your_twitter_username"