This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Commits</title> | |
| <script src="socket.io.js"></script> | |
| </head> | |
| <body> | |
| <script> | |
| io.setPath('/client/'); |
This file contains hidden or 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
| /* Basic Body Structure */ | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| font-size: 100%; | |
| word-wrap: break-word; | |
| } | |
| body { |
This file contains hidden or 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 django.shortcuts import get_object_or_404, render_to_response | |
| from django.template import RequestContext | |
| from myapp.models import Note | |
| def note_detail(request, slug): | |
| note = get_object_or_404(Note, slug=slug) | |
| editable = False | |
| if request.user.is_authenticated: |
This file contains hidden or 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
| [daniel@Europa:Desktop]: python riak_test.py | |
| Inserting 0 | |
| Inserting 1000 | |
| Inserting 2000 | |
| Inserting 3000 | |
| Inserting 4000 | |
| Inserting 5000 | |
| Inserting 6000 | |
| Inserting 7000 | |
| Inserting 8000 |
This file contains hidden or 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 haystack.indexes import * | |
| from haystack import site | |
| from cab.models import Snippet | |
| class SnippetIndex(SearchIndex): | |
| text = CharField(document=True, use_template=True) | |
| author = CharField(model_attr='author__username') | |
| title = CharField(model_attr='title') | |
| tags = CharField() | |
| tag_list = MultiValueField() |
This file contains hidden or 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 riak | |
| import uuid | |
| import time | |
| # For regular HTTP... | |
| # client = riak.RiakClient() | |
| # For Protocol Buffers (go faster!) | |
| client = riak.RiakClient(port=8087, transport_class=riak.RiakPbcTransport) |
This file contains hidden or 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
| # Drop me in ``~/Library/Application Support/Textual/Scripts``... | |
| # Usage is: ``/privatebrowse <url>`` | |
| on textualcmd(input) | |
| tell application "Google Chrome" | |
| activate | |
| end tell | |
| tell application "System Events" | |
| tell process "Google Chrome" | |
| tell menu bar 1 |
This file contains hidden or 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
| start on runlevel [23] | |
| stop on runlevel 1 | |
| stop on shutdown | |
| respawn | |
| script | |
| cd /home/solr | |
| java -jar start.jar | |
| end script |
This file contains hidden or 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 operator | |
| from haystack.query import SearchQuerySet, SQ | |
| query = 'lil way' | |
| sqs = SearchQuerySet().filter(reduce(operator.__and__, [SQ(name=word.strip()) for word in query.split(' ')])) |
This file contains hidden or 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
| # At a shell... | |
| mkdir whooshtest | |
| cd whooshtest | |
| virtualenv --no-site-packages . | |
| . bin/activate | |
| ./bin/pip install -E . django | |
| ./bin/pip install -E . django-haystack | |
| ./bin/pip install -E . whoosh==1.2.6 | |
| ./bin/django-admin.py startproject whooshtest |