Utilities for loading configuration from a YAML file.
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
Follow this instruction: https://www.mapbox.com/tilemill/docs/guides/osm-bright-mac-quickstart/ | |
Instead of downloading huge OSM datasets, download smaller areas from http://www.openstreetmap.org/export |
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
#!/bin/bash | |
SRC='/Volumes/apple-a' | |
DST='/Volumes/apple-b' | |
[ -d $SRC ] || { | |
echo "$SRC is not mounted"; | |
exit 1; | |
} |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import logging | |
import subprocess | |
import shutil | |
import tarfile | |
import tempfile | |
import argparse |
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
# convert MTS files to MOV for FCPX | |
ffmbc -i inFile -vcodec copy -strict experimental outFile |
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
# Emperor uWSGI script | |
description "uWSGI Emperor" | |
start on runlevel [2345] | |
stop on runlevel [06] | |
exec uwsgi --master --die-on-term --emperor /etc/uwsgi --logto=/var/log/uwsgi/emperor.log |
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
# -*- coding: utf-8 -*- | |
from .bananas import Bananas | |
from .base import the_api | |
the_api.add_url_rule('/bananas', view_func=Bananas.as_view('bananas')) | |
the_api.add_url_rule('/farm/<farm_id>/bananas', view_func=Bananas.as_view('bananas_from_a_farm')) | |
__all__ = [ |
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
test: | |
PYTHONPATH=. python test_dedot.py |
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
1. | |
=============== | |
xxx// Can you sehis? | |
// Given as input: 3 + 4 + 6 * 7 * 2 + 8 ... | |
// Assume just single digits, + and * | |
// Evaluate it. | |
// Walk through the following case: | |
// 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
# 1. palindrome window the size of string | |
# 2. split the window in half (omit central character is window size is odd) | |
# 3. compare substrings | |
# 4. if substings are equal - they are the longest palindrome | |
# 5. else slide the window to the right and repeat | |
# 6. if sliding the window right overflows the string, decrease the window and start again. | |
def find_longest_palindrome(input): | |
window_size = len(input) |