This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
import base64 | |
from myapplication import app | |
class MyTestCase(unittest.TestCase): | |
def setUp(self): | |
self.app = app.test_client() | |
def tearDown(self): | |
pass |
""" | |
From http://www.authorize.net/support/merchant/Transaction_Response/Response_Reason_Codes_and_Response_Reason_Text.htm | |
""" | |
REASONS = [ | |
# resp code, reason code, reason text, notes | |
[1, 1, "This transaction has been approved."], | |
[2, 2, "This transaction has been declined."], | |
[2, 3, "This transaction has been declined."], | |
[2, 4, "This transaction has been declined.", "The code returned from the processor indicating that the card used needs to be picked up."], |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import xlrd | |
import xlwt | |
from optparse import OptionParser | |
import datetime | |
""" | |
Merges excel files with multiple sheets with identical header lines into |
pv_by_industry = GROUP profile_view by viewee_industry_id | |
pv_avg_by_industry = FOREACH pv_by_industry | |
GENERATE group as viewee_industry_id, AVG(profie_view) AS average_pv; |
SSH agent forwarding is great. It allows you to ssh from one server to | |
another all the while using the ssh-agent running on your local | |
workstation. The benefit is you don't need to generate ssh key pairs | |
on the servers you are connecting to in order to hop around. | |
When you ssh to a remote machine the remote machine talks to your | |
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK | |
environment variable. | |
So you the remote server you can do something like: |
import cv2.cv as cv | |
import tesseract | |
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE) | |
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY) | |
api = tesseract.TessBaseAPI() | |
api.Init(".","eng",tesseract.OEM_DEFAULT) | |
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz") | |
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD) | |
tesseract.SetCvImage(gray,api) | |
print api.GetUTF8Text() |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
var mongoose = require('mongoose'); | |
var wait = require('wait.for'); | |
mongoose.connect('localhost', 'non_async_tests'); | |
var itemSchema = new mongoose.Schema({ | |
name: String | |
}); | |
var Item = mongoose.model("Item", itemSchema); |
' http://support.microsoft.com/kb/291296/en-us | |
' http://superuser.com/questions/130592/how-do-you-force-excel-to-quote-all-columns-of-a-csv-file | |
' - change integer to long indexing | |
' http://stackoverflow.com/questions/2524703/save-text-file-utf-8-encoded-with-vba | |
' - output utf8 content | |
Sub QuoteCommaExport() | |
' Dimension all variables. | |
Dim DestFile As String | |
Dim FileNum As Integer |