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 heapq import heappush, heappop | |
def run(): | |
album_songs_count, songs_count = raw_input().split() | |
album_songs_count = int(album_songs_count) + 1 | |
songs_count = int(songs_count) | |
songs = [] | |
for i in xrange(1, album_songs_count): |
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
""" | |
Hound: Caffeinated coffee watchdog | |
Watches root directory of coffee script files, | |
detects changes and new files then compiles them into | |
js files preserving directory structure. | |
""" | |
import os | |
import sys |
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
import hmac | |
import hashlib | |
import time | |
import uuid | |
SYSTEM_WIDE_SECRET = 'supersecret' | |
GENERATED_TOKENS = {} | |
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
# <app>.controllers.root.py | |
class BaseController(object): | |
""" | |
Base controller which main app should extend to auto mount vendor apps. | |
""" | |
def __init__(self): | |
for app, pkg in conf.vendor_apps: | |
root_controller = importlib.import_module("%s.controllers.root" % pkg) | |
setattr(self, app, root_controller.RootController()) |
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
def app(environ, start_response): | |
"""Simplest possible application object""" | |
data = 'Hello, World!\n' | |
status = '200 OK' | |
response_headers = [ | |
('Content-type','text/plain'), | |
('Content-Length', str(len(data))) | |
] | |
start_response(status, response_headers) | |
return iter([data]) |
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
### | |
Compiles coffee scripts from coffee/ to js/. | |
### | |
fs = require 'fs' | |
{exec} = require 'child_process' | |
util = require 'util' | |
path = require 'path' | |
appFiles = [] |
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 -*- | |
""" | |
Watchless will compile your less files whenever it detects changes. | |
Accepts one argument, the path where your less files are stored. | |
Say your less files are store in /static/less and it contains the file | |
layout.less, watchless will compile it and store the compiled css file | |
in /static/css/layout.css. |
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 -*- | |
""" | |
Watchless will compile your less files whenever it detects changes. | |
Accepts one argument, the path where your less files are stored. | |
Say your less files are store in /static/less and it contains the file | |
layout.less, watchless will compile it and store the compiled css file | |
in /static/css/layout.css. |
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
import redis | |
import gevent | |
import itertools | |
from gevent import monkey | |
monkey.patch_socket() | |
QUEUE_NAME = 'queue' |
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 -*- | |
##################################################### | |
## Cloud CLI is a basic Dropbox client that lets you: | |
## upload, download, move and list files. | |
## | |
## Requirements: cmd2, Dropbox Python SDK | |
###################################################### | |