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 http://www.leancrew.com/all-this/2008/05/snapshotupload-utility-with-gui/ On Wednesday, February 11, 2009 2:11:19 PM I have snapftp saved in my ~/Library/Scripts folder where FastScripts can get at it. The Pashua application is saved in /Applications, as expected, and the Pashua.py Python module is saved in /Library/Python/2.5/site-packages. The module has one line that I feel is unwarranted and that I have commented out. Down near the bottom of Pashua.py, is a loop that looks like this: | |
for Line in Result: | |
print Line | |
Parm, Value = Line.split('=') | |
ResultDict[Parm] = Value.rstrip() | |
I think a print command in a library utility that is supposed to read lines is just plain wrong, so IÕve commented out the print Line. |
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
-- A function for escaping URLs and skeleton code for a test. | |
on URLescape(myURL) | |
set myURL to quoted form of myURL | |
set myURL to text from character 2 to -2 of myURL | |
set cmd to " | |
from urllib import quote | |
print quote(\"" & myURL & "\", \"/:\") | |
" | |
--return cmd |
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 perl | |
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs | |
# License: See below. | |
# http://gist.github.com/507356 | |
use strict; | |
use warnings; | |
use URI::Escape; |
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 perl | |
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs | |
# License: See below. | |
# http://gist.github.com/507356 | |
use strict; | |
use warnings; | |
use URI::Escape; |
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
// Change straight quotes to curly and double hyphens to em-dashes. | |
function smarten(a) { | |
a = a.replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018"); // opening singles | |
a = a.replace(/'/g, "\u2019"); // closing singles & apostrophes | |
a = a.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201c"); // opening doubles | |
a = a.replace(/"/g, "\u201d"); // closing doubles | |
a = a.replace(/--/g, "\u2014"); // em-dashes | |
return a | |
}; |
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
#!/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" |
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
<html> | |
<head> | |
<title>matplotlib.pyplot contents</title> | |
<style type="text/css"> | |
table { | |
border-collapse: collapse; | |
} | |
table th { | |
padding: .5em 1em .25em 1em; |
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
<html> | |
<head> | |
<title>MathJax Test</title> | |
<meta name="generator" content="BBEdit"> | |
<script type="text/javascript" | |
src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
</script> | |
</head> | |
<body> |
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/python | |
import Image | |
import base64, zlib | |
# Jay Parlar convinced me to turn this data structure | |
# from a dictionary into an object. | |
class PackedImage(object): | |
def __init__(self, mode, size, data): | |
self.mode = mode |
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
import Image | |
from Cleanbar import cleanbar | |
import console, photos | |
s1 = cleanbar(photos.pick_image()) | |
s2 = cleanbar(photos.pick_image()) | |
w = s1.size[0] + s2.size[0] + 60 | |
h = max(s1.size[1], s2.size[1]) + 40 | |
ss = Image.new('RGB', (w,h), '#888') |
OlderNewer