This file contains hidden or 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
| ### Generic Dockerfile demonstrating good practices | |
| ### Imports | |
| # Bad-ish, we do not need Ubuntu for this, nor do we want latest if we are using in a build system, predictable is better | |
| FROM ubuntu:latest | |
| # Better, using a small image since our app has no dependency on Ubuntu | |
| FROM alpine:3.3 |
This file contains hidden or 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
| */5 * * * * www-data /usr/local/bin/generate_index.sh |
This file contains hidden or 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 UserDict import IterableUserDict | |
| import collections | |
| __author__ = 'github.com/hangtwenty' | |
| def tupperware(mapping): | |
| """ Convert mappings to 'tupperwares' recursively. |
Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
This file contains hidden or 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
| (defn get-clipboard [] | |
| (.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit))) | |
| (defn slurp-clipboard [] | |
| (try | |
| (.getTransferData (.getContents (get-clipboard) nil) (java.awt.datatransfer.DataFlavor/stringFlavor)) | |
| (catch java.lang.NullPointerException e nil))) | |
| (defn spit-clipboard [text] | |
| (.setContents (get-clipboard) (java.awt.datatransfer.StringSelection. text) nil)) |