Skip to content

Instantly share code, notes, and snippets.

View jonallured's full-sized avatar
🥃
very nice code

Jon Allured jonallured

🥃
very nice code
View GitHub Profile
@jonallured
jonallured / cooney.rb
Created May 14, 2018 13:38
Loop with Feedjira
feed_urls = ["http://jonallured.com/atom.xml", "http://feedjira.com/blog/feed.xml"]
feed_urls.each do |feed_url|
feed = Feedjira.fetch_and_parse(feed_url)
# ...do something with feed here
end
@jonallured
jonallured / config.yml
Created December 20, 2017 19:27
Volt Circle 2.0 Config
version: 2
base: &base
working_directory: ~/volt
docker:
- image: artsy/volt-testing
environment:
RAILS_ENV: test
- image: redis:3.2.10-alpine

Keybase proof

I hereby claim:

  • I am jonallured on github.
  • I am jonallured (https://keybase.io/jonallured) on keybase.
  • I have a public key ASDIy4lphHm60JjToM2NO94NkQoV5upYab3eAga3ocPZDgo

To claim this, I am signing this object:

import urllib.request, json
def lambda_handler(_event, _context):
with urllib.request.urlopen("https://daringfireball.net/feeds/json") as url:
data = json.loads(url.read().decode())
keys = ["id", "url", "title", "date_published"]
items = data["items"]
new_items = []
@jonallured
jonallured / detention.rb
Created March 26, 2016 13:57
The Breakfast Club written and directed by John Hughes
require 'net/http'
class BratBot
def initialize(name, bot_id, delay)
@name, @bot_id, @delay = name, bot_id, delay
end
def speak
loop { sleep delay; puts post }
end
urls = ["http://feedjira.com/blog/feed.xml", "http://jonallured.com/atom.xml"]
feeds = urls.map { |url| Feedjira::Feed.fetch_and_parse url }
feeds.map { |feed| feed.title }
# => ["Feedjira Blog", "Jon Allured"]
@jonallured
jonallured / ViewController.swift
Created June 19, 2015 13:44
In-App WAC with Swift and unsafeBitCast
import UIKit
import ExternalAccessory
class ViewController: UIViewController, EAWiFiUnconfiguredAccessoryBrowserDelegate {
var accessoryBrowser: EAWiFiUnconfiguredAccessoryBrowser?
override func viewDidLoad() {
super.viewDidLoad()
accessoryBrowser = EAWiFiUnconfiguredAccessoryBrowser.init(delegate: self, queue: nil)
accessoryBrowser?.startSearchingForUnconfiguredAccessoriesMatchingPredicate(nil)
@jonallured
jonallured / feedjira.rb
Created February 5, 2015 21:42
Add common feed element
Feedjira::Feed.add_common_feed_element("image")
feed = Feedjira::Feed.fetch_and_parse("http://cltampa.com/tampa/Rss.xml?section=2065818")
feed.image
# => http://cltampa.com/binary/9697/adminIcon_clTampa.jpg
@jonallured
jonallured / heroku.html
Created January 7, 2015 15:27
Painzones
<!DOCTYPE html>
<html>
<head>
<title>PainZones</title>
<link rel="stylesheet" media="all" href="/assets/application-7eadaa6a15e069d84c07540345524b0e.css" data-turbolinks-track="true" />
<script src="/assets/application-9e487c229e80a9801080a510f15708b7.js" data-turbolinks-track="true"></script>
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="Y07y3+TVyGsxAF0zE8Cu6Uaz2zdpb1OWZdeEnJVGTV+m0skCNPNMuTUTutwiPBghO01l+r6AjD9n72RIGHtFHg==" />
</head>
<body>
@jonallured
jonallured / hsync.sh
Created August 19, 2014 19:10
sync heroku dbs
#!/usr/bin/env bash
remote="${1:-staging}"
capture() {
heroku pgbackups:capture --expire --remote $1
}
url() {
heroku pgbackups:url --remote $1
}