Skip to content

Instantly share code, notes, and snippets.

@mittenchops
mittenchops / findbytheword.sh
Created July 17, 2013 20:09
Find all files that contain a particular word, recursively in the current directory. This is the version that doesn't use xargs, which I think would look more like this: http://www.cyberciti.biz/faq/howto-recursively-search-all-files-for-words/
find . -type f -exec grep -l "wordofinterest" {} +
@zeeshanlakhani
zeeshanlakhani / make_turk_job.py
Created October 28, 2011 21:47 — forked from aparrish/make_turk_job.py
make a mechanical turk job with boto
import boto.mturk
import boto.mturk.connection
import boto.mturk.price
from boto.mturk.question import *
import sys
question = QuestionForm([
Question(
identifier=1,
content=QuestionContent([
@tsoporan
tsoporan / manual_nltk_bayes_classify.py
Created October 6, 2011 04:05 — forked from lrvick/manual_nltk_bayes_classify.py
Manually train an NLTK NaiveBayes Classifier
from nltk.probability import DictionaryProbDist
from nltk import NaiveBayesClassifier
from nltk import FreqDist, ConditionalFreqDist
from nltk import BigramAssocMeasures
train_samples = {
'I hate you and you are a bad person': 'neg',
'I love you and you are a good person': 'pos',
'I fail at everything and I want to kill people' : 'neg',
'I win at everything and I want to love people' : 'pos',
#!/usr/bin/env python
### Requires latest boto (cuz I checked in code to boto a moment ago)
import uuid
from boto.mturk.connection import MTurkConnection
from boto.mturk.question import Question, QuestionForm, QuestionContent
from boto.mturk.question import AnswerSpecification, FreeTextAnswer
from boto.mturk.question import Overview
#from boto.mturk.qualification import Qualifications # these exist!