Skip to content

Instantly share code, notes, and snippets.

Avatar
🥃
very nice code

Jon Allured jonallured

🥃
very nice code
View GitHub Profile
@jonallured
jonallured / cooney.rb
Created May 14, 2018
Loop with Feedjira
View cooney.rb
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 Dec 20, 2017
Volt Circle 2.0 Config
View config.yml
version: 2
base: &base
working_directory: ~/volt
docker:
- image: artsy/volt-testing
environment:
RAILS_ENV: test
- image: redis:3.2.10-alpine
View keybase.md

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:

View faring_direball.py
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 Mar 26, 2016
The Breakfast Club written and directed by John Hughes
View detention.rb
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
View feed_names.rb
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 Jun 19, 2015
In-App WAC with Swift and unsafeBitCast
View ViewController.swift
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 Feb 5, 2015
Add common feed element
View feedjira.rb
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
View heroku.html
<!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 Aug 19, 2014
sync heroku dbs
View hsync.sh
#!/usr/bin/env bash
remote="${1:-staging}"
capture() {
heroku pgbackups:capture --expire --remote $1
}
url() {
heroku pgbackups:url --remote $1
}