Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
First, install it from http://www.sublimetext.com/2 | |
Next, install the package control extension from here: | |
http://wbond.net/sublime_packages/package_control | |
Installation instructions here: http://wbond.net/sublime_packages/package_control/installation | |
Restart Sublime, then hit Shift+Apple+P and search for "Package Control: Install Package" |
Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
#!/usr/bin/env sage | |
import pickle | |
from math import * | |
from pylab import * | |
""" | |
See: http://goo.gl/y2A78 for information | |
and how this was put together/concepted |
from zope.testbrowser.browser import Browser | |
def _zope_testbrowser_pyquery(self): | |
from pyquery import PyQuery | |
return PyQuery(self.contents) | |
Browser.pyquery = property(_zope_testbrowser_pyquery) | |
# This will allow you to do in your tests: | |
# >>> "Home" in browser.pyquery('#navigation').text() |
# Bash command in a loop: | |
while true; do uptime >> /tmp/uptime.log; sleep 5; done | |
# Use awk to strip it out and grab 1min figure | |
awk -F\ '{print $9}' la.txt | tr "," " " > uptime_1min.csv | |
# In pylab (via:) run: | |
ipython --pyab | |
d = numpy.genfromtext('uptime_1min.csv') | |
plot(d) |
first, and you probably wont really ever need this unless you're doing a bare bones install of a cent/rhel box, the webtactic repo maintains a decently up to date git install that will cleaning go onto such a box:
sudo rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
sudo yum install --enablerepo=webtatic git-all
Now you have working git!
# -*- coding: utf-8 -*- | |
""" | |
1) A string is a palindrome if it reads the same from left-to-right as it does right-to-left. | |
e.g “nolemonnomelon”, “racecar” & “neveroddoreven” are all palindromes. | |
A string is an anagram of another string if it consists of exactly the same characters but in another order. | |
e.g The string “carrace” is an anagram of “racecar”. | |
Write a function `def is_anagram_of_palindrome(str):` | |
such that it returns True if the string str is an anagram of a palindrome, and otherwise returns False. | |
You may assume that str contains only lowercase characters a-z and is not empty. | |
e.g Given str = “carrace” the function should return True as it is an anagram of the palindrome “racecar”. |
[global] | |
server: smtp.gmail.com | |
port: 587 | |
user: jaymzcd@gmail.com | |
password: ??????? | |
[message] | |
text: /tmp/email/plain.txt | |
html: /tmp/email/index.html | |
from: jaymzcd@gmail.com |
def assign_file_to_model(module, model_class=None, file_field='main_image', source_field='body', skip_existing=True, verbose=False): | |
""" We tend to have "main image" fields on models that hold a primary image used | |
across the sites for things like list pages and headers. Often on import of | |
existing data we have images mangled within copy or lists. """ | |
import urllib2 | |
from posixpath import basename | |
from BeautifulSoup import BeautifulSoup as Soup | |
from django.db import IntegrityError |
<script type="text/javascript"> | |
/* Can't remember where I saw this but it's quite handy/cool for tables to do filtering without posts */ | |
$(document).ready(function(){ | |
//add index column with all content. | |
$(".filterable tr:has(td)").each(function(){ | |
var t = $(this).text().toLowerCase(); //all row text | |
$("<td class='indexColumn'></td>") | |
.hide().text(t).appendTo(this); | |
});//each tr | |
$("#FilterTextBox").keyup(function(){ |