Skip to content

Instantly share code, notes, and snippets.

View mmulich's full-sized avatar

Michael Mulich mmulich

View GitHub Profile
@mmulich
mmulich / gist:2258808
Created March 31, 2012 02:42
brew install -v gst-plugins-good
==> Downloading http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-0.10.30.tar.bz2
Already downloaded: /Library/Caches/Homebrew/gst-plugins-good-0.10.30.tar.bz2
/usr/bin/tar xf /Library/Caches/Homebrew/gst-plugins-good-0.10.30.tar.bz2
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/gst-plugins-good/0.10.30 --disable-schemas-install --disable-gtk-doc --disable-goom --with-default-videosink=ximagesink
./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/gst-plugins-good/0.10.30 --disable-schemas-install --disable-gtk-doc --disable-goom --with-default-videosink=ximagesink
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
@mmulich
mmulich / brew_--config
Created April 13, 2012 01:41
brew install glib
$ brew --config
HOMEBREW_VERSION: 0.9
HEAD: 11e6add33b648014bf57f0da14abce4587ce040a
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 16-core 64-bit nehalem
OS X: 10.6.8
Kernel Architecture: x86_64
Xcode: 3.2.6
GCC-4.0: build 5494
@mmulich
mmulich / gist:2785577
Created May 25, 2012 03:25
repoze.sendmail.mailer related exception
Traceback (most recent call last):
File ".../env/lib/python3.2/site-packages/pyramid_debugtoolbar-1.0.2-py3.2.egg/pyramid_debugtoolbar/toolbar.py", line 122, in toolbar_tween
response = _handler(request)
File ".../env/lib/python3.2/site-packages/pyramid_debugtoolbar-1.0.2-py3.2.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
result = handler(request)
File ".../env/lib/python3.2/site-packages/pyramid_debugtoolbar-1.0.2-py3.2.egg/pyramid_debugtoolbar/panels/performance.py", line 85, in profile_handler
result = self.profiler.runcall(handler, request)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/cProfile.py", line 144, in runcall
return func(*args, **kw)
File "../env/lib/python3.2/site-packages/pyramid-1.4dev-py3.2.egg/pyramid/tweens.py", line 20, in excview_tween
@mmulich
mmulich / jod-service.rst
Last active December 16, 2015 00:29
cnx-transforms

JOD Service

JOD (Java Open Document converter) is an alternative to the *office headless mode that we wish to use in production. In the past the *office headless mode was used, but it is not ideal and not a suitable solution for concurrent builds. It will remain available for developers to use as a feasible alternative to the heavy handed JOD service.

@mmulich
mmulich / faq.rst
Last active December 17, 2015 10:09
Auth services stories

Frequently Asked Questions

How do I run a service and cnx-user on the same machine?

Under normal circumstances, cnx-user and a remote service would be on two differing addresses or machines. And this works great because cnx-user is setup to by-pass token generation and validation for local requests. It's done this way to support its own underlying functionality for

# ...
class CheckTests(unittest.TestCase):
# These tests assume a remote (or local) service is communicating with
# this service to verify the token it was given is valid.
def setUp(self):
self.config = testing.setUp()
from sqlalchemy import create_engine
engine = create_engine('sqlite://')

Instructions for People Not Called Ross on Fillet

Important locations

Most everything runs from /opt/beta

/opt/beta - root

@mmulich
mmulich / pub.rst
Last active January 4, 2016 00:49

License

  • GET license on existing content /publications/{id}/license/{user-id} returns 200 Ok.
  • GET license for content that needs license acceptance /publications/{id}/license/{user-id} returns 400 Bad Request.
  • POST license for content that needs license acceptance /publications/{id}/license/{user-id} accepts license and returns 200 Ok.

Roles

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html> <!-- This is required in HTML5 -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:lrmi="http://lrmi.net/the-specification"
>
<!-- For EPUB parsing/validation python should only care about data-* attributes.
Other attributes are for discoverability and compatibility with schema.org . -->
diff --git a/cnxpublishing/db.py b/cnxpublishing/db.py
index d702f41..eeb1c77 100644
--- a/cnxpublishing/db.py
+++ b/cnxpublishing/db.py
@@ -103,6 +103,17 @@ update pending_documents set license_accepted = 't'
where id = %s""", (document_id,))
+def add_pending_resource(cursor, resource):
+ """Adds a pending resource to the database."""