Skip to content

Instantly share code, notes, and snippets.

View cmason's full-sized avatar

Chris Mason cmason

View GitHub Profile
@cmason
cmason / jsonfeed.swagger.yaml
Created June 1, 2017 22:53
Swagger definition for JSONFeed
swagger: '2.0'
info:
version: 'version.1'
title: 'JSON Feed Version 1'
description: 'The JSON Feed format is a pragmatic syndication format, like RSS and Atom, but with one big difference: it’s JSON instead of XML.'
paths:
/:
get:
summary: Get the JSON feed
description: |
@cmason
cmason / redis-cli-uri
Created March 31, 2017 19:53
Use redis-cli with a URI
#!/usr/bin/env ruby
require 'uri'
if ARGV.empty?
puts "Usage: redis-cli-uri <uri> [REDIS-CLI OPTIONS] [cmd [arg [arg ...]]]"
exit 1
end
uri = URI.parse(ARGV.shift)
system(%Q(redis-cli -h "#{uri.host}" -p "#{uri.port}" -a "#{uri.password}" #{ARGV.join(' ')}))
@cmason
cmason / keybase.md
Created April 14, 2014 18:27
Keybase Identity Proof

Keybase proof

I hereby claim:

  • I am cmason on github.
  • I am tokenturtle (https://keybase.io/tokenturtle) on keybase.
  • I have a public key whose fingerprint is F173 C9BF 67DB 1F7B 124E 1925 494A F0F9 4AE3 6A31

To claim this, I am signing this object:

@cmason
cmason / OG_ex3
Created January 3, 2012 16:20
Like button
<div class="fb-like" data-send="false" data-width="450" data-show-faces="true"></div>
@cmason
cmason / OG_ex2
Created January 3, 2012 16:19
Include Facebook SDK
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#">
...
<body>
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
@cmason
cmason / OG_ex1
Created January 3, 2012 16:17
Example Open Graph markup
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>KIF in Action | ChaiONE</title>
<meta property="og:type" content="blog" />
<meta property="og:url" content="http://http://blog.chaione.com/kif-in-action" />
<meta property="og:image" content="http://www.example.com/ogp_image.jpg" />
<meta property="og:site_name" content="Chaione" />
<meta property="og:description" content="To keep a product relevant it must adapt and change over time. Over the lifetime of a product many features will be added and some will be removed. " />
<meta property="fb:admins" content="123456789,987654321" />