Ubuntu's analog of robcowie / postgis_timezone_db.markdown
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install postgresql-9.1-postgis
Ubuntu's analog of robcowie / postgis_timezone_db.markdown
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install postgresql-9.1-postgis
def get_video_info(path): | |
"""Uses ffmpeg to determine information about a video. This has not been broadly | |
tested and your milage may vary""" | |
from decimal import Decimal | |
import subprocess | |
import re | |
process = subprocess.Popen(['/usr/bin/ffmpeg', '-i', path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
stdout, stderr = process.communicate() |
from collections import defaultdict | |
import concurrent.futures | |
class TasksGroup(object): | |
"""A group of tasks with dependencies. | |
>>> tasks = TasksGroup() | |
>>> @tasks.add() |
# python (flask) side: | |
import time | |
from flask import Response | |
app = Flask(__name__) | |
@app.route('/event_stream') | |
def stream(): | |
def event_stream(): |
class Monad: | |
@staticmethod | |
def unit(val): | |
raise NotImplemented | |
def bind(self, fn): | |
raise NotImplemented | |
def map(self, map_fn): | |
""" |
def one(iterable): | |
"""Return the object in the given iterable that evaluates to True. | |
If the given iterable has more than one object that evaluates to True, | |
or if there is no object that fulfills such condition, return False. | |
>>> one((True, False, False)) | |
True | |
>>> one((True, False, True)) | |
False |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select | |
import re | |
import codecs |
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
/** | |
* Watching | |
* ======== |