Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jkeyes on github.
  • I am jkeyes (https://keybase.io/jkeyes) on keybase.
  • I have a public key ASDDMRXzjwn4PPmjtW1Gnt2DD_4vsvg9HeY-3Rn9tU7aQAo

To claim this, I am signing this object:

@jkeyes
jkeyes / _vimeo.html
Last active November 16, 2016 20:07
ResponsiveEmbedConverter
<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style>
<div class='embed-container'>
<iframe src='{{ scheme }}://player.vimeo.com/video/{{ video_id }}' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>
@jkeyes
jkeyes / compile a directory
Last active August 29, 2015 14:00
Quickie to compile Python modules
import compileall
sys.exit(not compileall.compile_dir('modules_dir', quiet=1))
@jkeyes
jkeyes / html5test.rb
Created September 21, 2013 09:01
Nokogiri doesn't appear to support HTML5 validation.
require 'rubygems'
require 'nokogiri'
markup = <<-eom
<!DOCTYPE html>
<html>
<body>
<header>
<h1>HTML5</h1>
</header>
@jkeyes
jkeyes / wercker.yml
Created September 2, 2013 13:48
Heroku Deploy on Wercker
deploy:
steps:
- heroku-deploy
- script:
name: install heroku-exit-status plugin
code: heroku plugins:install https://github.com/glenngillen/heroku-exit-status.git
- script:
name: migrate with south
code: heroku run "python manage.py migrate" -a $HEROKU_APP_NAME
@jkeyes
jkeyes / async.py
Created August 21, 2013 21:00
Docraptor async example
import time
from docraptor import DocRaptor
docraptor = DocRaptor()
print "Create PDF"
# resp = docraptor.create({
# 'document_content': '<h1>python-docraptor</h1><p>Async Test</p>',
# 'test': True,
# 'async': True
@jkeyes
jkeyes / wercker.yml
Last active December 18, 2015 13:09
Install lessc on wercker
box: wercker/python
build:
steps:
- script:
name: "install lessc with sudo"
code: |-
curl https://npmjs.org/install.sh | sudo bash
sudo npm install less -g
- script:
name: "install lessc locally"
@jkeyes
jkeyes / 1-pre.md
Last active December 14, 2015 17:39
A tagged pre block extension (1-pre.md). The `prettypre` extension inserts 'prettyprint' into the class attribute of the `pre` and if there is an additional token it inserts a language class on the `code` element (a child of `pre`) (2-pre.html). And the result after prettifying (3-pretty-pre.html).
@prettyprint python
class PrettyPreExtension (markdown.Extension):

    def extendMarkdown(self, md, md_globals):
        md.registerExtension(self)
        self.processor = PreTreeprocessor()
        self.processor.md = md
        self.processor.config = self.getConfigs()
@jkeyes
jkeyes / index.coffee
Last active December 10, 2015 06:18
Updated sample code for the "Stitch It Up" example from "The Little Book of CoffeeScript".
"use strict"
require("coffee-script")
stitch = require("stitch")
express = require("express")
argv = process.argv.slice(2)
pkg = stitch.createPackage(
# Specify the paths you want Stitch to automatically bundle up
paths: [ __dirname + "/app"],
@jkeyes
jkeyes / acme.rst
Created November 28, 2012 10:21
ReST Hyperlink with Unicode

The following ReST:

|Acme(TM)|_

.. |Acme(TM)| unicode:: Acme U+2122
.. _Acme(TM): http://example.com

produces this HTML:

|Acme(TM)|_