This article is now published on my website: Prefer Subshells for Context.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, redirect, url_for, make_response, abort | |
from werkzeug import secure_filename | |
from pymongo import Connection | |
from pymongo.objectid import ObjectId | |
from gridfs import GridFS | |
from gridfs.errors import NoFile | |
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) | |
DB = Connection().gridfs_server_test | |
FS = GridFS(DB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#<site_root>/functions.py | |
from hyde.plugin import Plugin | |
def quoted(var): | |
return '"%s"' % var | |
class MyJinjaLoader(Plugin): | |
def template_loaded(self, template): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remapped on kinesis itself | |
-------------------------------------------------------------------------------- | |
caps lock -> backspace (freq use) | |
backspace -> right gui/windows (freq use) | |
left alt -> return/enter (very infreq use) | |
right ctrl -> return/enter (freq use) | |
right gui/windows -> left gui | |
enter -> right gui (infreq use) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
SYNOPSIS | |
flask_gridfs_images.py --start | |
flask_gridfs_images.py --add <IMAGE_URL> | |
DESCRIPTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Simple script for finding and counting the color pages in a PDF | |
# Copyright (C) 2013-2019 Antonio Garcia-Dominguez | |
# Licensed under the GPLv3 | |
# | |
# This script is based on the following thread (thanks for the tip!): | |
# | |
# http://tex.stackexchange.com/questions/53493 | |
# |
I think the most confusing thing that I have found about Ruby on Rails so far has been the transition from (trying to) write code myself to the use of the fabled "Rails Magic". So, to help my own understanding of a few core Ruby on Rails concepts, I have decided to write something on what I think is a CRITICAL topic... the idea of Convention over Configuration and why (in my mind) it is the most important thing that helps Rails become magic!
(This may be a topic that we cover in more detail in class but as I said, I'm writing this for my own understanding... I hope it helps someone else understand things too... Perhaps you can give me a hand when I'm crying next week!)
##Convention over configuration ###What does this "actually" mean...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Simple demonstration of using ZMQ's Curve authentication. | |
This demo is adapted from the examples given in the `PyZMQ repository`__. Key | |
differences include: | |
* Using ``setsockopt`` to set Curve parameters instead of setting attributes | |
directly (help out your IDE!) | |
* Integration with ``asyncio`` | |
__ https://github.com/zeromq/pyzmq/tree/master/examples |
OlderNewer