#Mac OS X
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 django.core.exceptions import MiddlewareNotUsed | |
from django.conf import settings | |
from django.db import connection | |
from pymongo.connection import Connection | |
from time import time | |
import struct | |
import bson | |
from bson.errors import InvalidBSON | |
class SqldumpMiddleware(object): |
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
""" | |
This module provides a simple WSGI profiler middleware for finding | |
bottlenecks in web application. It uses the profile or cProfile | |
module to do the profiling and writes the stats to the stream provided | |
To use, run `flask_profiler.py` instead of `app.py` | |
see: http://werkzeug.pocoo.org/docs/0.9/contrib/profiler/ | |
and: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvi-debugging-testing-and-profiling | |
""" |
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 | |
import logging | |
import multiprocessing | |
import os | |
import urllib2 | |
import subprocess | |
import sys | |
import time | |
from xml.etree import ElementTree |
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
Public Function getRowNum(worksheetName, rowName, headerColumnNum) As Integer | |
Set worksheet = Worksheets(worksheetName) | |
rowNum = 0 | |
lastRowNum = worksheet.Cells(worksheet.Rows.Count, headerColumnNum).End(xlup).Row | |
For rowLoopNum = 1 To lastRowNum | |
If worksheet.Cells(rowLoopNum, headerColumnNum).Value = rowName Then | |
rowNum = rowLoopNum | |
End If | |
Next rowLoopNum | |
getRowNum = rowNum |
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
# sync-repo | |
# Dependencies: | |
# rsync (https://rsync.samba.org) | |
############################## BEGIN APP CONFIG ############################### | |
# You should only have to modify this section | |
# All paths are relative to your home | |
# Name of project to sync (used for notifications) |
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
app=$HOME/apps/nzbget-loop | |
cat > $app << EOF | |
#!/usr/bin/env bash | |
export TERM="xterm" | |
until ~/apps/nzbget/nzbget -s; do | |
echo "NZBGet crashed. Respawning.." >&2 | |
sleep 1 | |
done | |
EOF | |
chmod +x $app |
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
# This script adds a "Webclip" shortcut to your homescreen. | |
# The shortcut can be used to open a web page in full-screen mode, | |
# or to launch a custom URL (e.g. a third-party app). | |
# You'll be asked for a title, a URL, and an icon (from your camera roll) | |
import plistlib | |
import BaseHTTPServer | |
import webbrowser | |
import uuid | |
from io import BytesIO |
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 -*- | |
# | |
# Description: Sync Plex playlists to shared users. | |
# Author: /u/SwiftPanda16 | |
# Requires: plexapi, requests, xmltodict | |
import requests | |
import xmltodict |