Skip to content

Instantly share code, notes, and snippets.

@tony-landis
tony-landis / CsvToArray.py
Created December 5, 2008 18:03
Convert CSV string to fixed width text table
"""
Convert CSV string to fixed width text table. Supports multi-line rows, column width limits, and creates a header row automatically
@author Tony Landis
@link http://www.tonylandis.com
@license GPL
"""
from math import ceil
class CsvToTxt():
@macdrifter
macdrifter / rss-subscribers.sh
Created September 26, 2012 00:38
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default).
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic.
# Required variables:
RSS_URI="/rss"
MAIL_TO="[email protected]"
LOG_FILE="/var/log/httpd/access_log"
@omz
omz / FileTransfer.py
Last active September 6, 2024 01:50
File Transfer script for Pythonista (iOS)
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
@ttscoff
ttscoff / formd-pythonista.py
Created October 17, 2012 18:24
A modified version of formd for use with Pythonista on iOS
# encoding=utf8
"""
formd by Seth Brown, 02-24-12
modified for iOS use (Pythonista) by Brett Terpstra, 10-17-12
"""
from sys import stdin, stdout
import clipboard
import re
from collections import OrderedDict
@wrenoud
wrenoud / DropboxSync.py
Created November 10, 2012 02:46
DropboxSync
import os
import sys
import pickle
import console
# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')]
import dropboxlogin # this code can be found here https://gist.github.com/4034526
STATE_FILE = '.dropbox_state'
@bferg
bferg / feedfolder.rb
Created July 1, 2013 03:00
Create Feed Wrangler "smart streams" matching your Google Reader folders. First import your feeds from Google Reader, export your Reader OPML file to the script directory, edit the script to include your user name and password, then run it. Note Feed Wrangler has since added this feature, so this script should no longer be necessary!
#!//usr/bin/env ruby
require 'bundler/setup'
require 'opml_saw'
require 'json'
require 'net/https'
require 'uri'
#
# Enter your email and password for feedwrangler below
#
@ryanbillingsley
ryanbillingsley / ffmpeg.sh
Last active November 14, 2016 15:50
Jason Snell's Automator service that converts to AIFF via ffmpeg.
for i in "$@" ; do /Users/jsnell/ffmpeg -i "$i" -map 0:0 -acodec pcm_s161e -ac 1 -out_sample_rate 44100 "${i%.*}.wav" ;
done
@jasonsnell
jasonsnell / gist:1b728736c636272bc5da
Last active January 18, 2022 22:17
Use this in an Automator action set to accept file input from the command line
for i in "$@" ; do /Users/jsnell/ffmpeg -i "$i" -map 0:0 -acodec pcm_s16le -ac 1 -out_sample_rate 44100 "${i%.*}.wav" ; done