Skip to content

Instantly share code, notes, and snippets.

:octocat:
Thinking about: Data & Collaboration

Idan Gazit idan

:octocat:
Thinking about: Data & Collaboration
View GitHub Profile
View gist:69228
#import <Python/Python.h>
int main(int argc, char *argv[])
{
PyObject *psrcstring, *pwriter_name_string, *pmodule, *pmethod, *presult;
PyTupleObject *pmethodargs;
PyDictObject *pmethodnamedargs;
char *output;
char *source = "Djoosh \n======\n\n`Djoosh`_ is a reusable django app which provides extensible, pure-python fulltext indexing for Django models using the `Whoosh`_ information-retrieval library. \n\nThe djoosh project lives at http://github.com/idangazit/djoosh/.\n\n.. _Djoosh: http://github.com/idangazit/djoosh/\n\n\nProject Goals\n-------------\n\nDjoosh will:\n \n * be a **pure-python** fulltext indexing solution. There are many fine solutions based around `Lucene`_ and `Solr`_ (java), or `Xapian`_ (C/C++). There is even one solution (`django-search`_) which provides pluggable indexing backends much like the ORM supports various DB backends. This project utilizes `Whoosh`_ exclusively.\n * be simple enough to make \"**out of the box indexing**\" no harder than registering a
View gist:69229
#import <Python/Python.h>
int main(int argc, char *argv[])
{
PyObject *psrcstring, *pwriter_name_string, *pmodule, *pmethod, *presult;
PyTupleObject *pmethodargs;
PyDictObject *pmethodnamedargs;
char *output;
char *source = "Djoosh \n======\n\n`Djoosh`_ is a reusable django app which provides extensible, pure-python fulltext indexing for Django models using the `Whoosh`_ information-retrieval library. \n\nThe djoosh project lives at http://github.com/idangazit/djoosh/.\n\n.. _Djoosh: http://github.com/idangazit/djoosh/\n\n\nProject Goals\n-------------\n\nDjoosh will:\n \n * be a **pure-python** fulltext indexing solution. There are many fine solutions based around `Lucene`_ and `Solr`_ (java), or `Xapian`_ (C/C++). There is even one solution (`django-search`_) which provides pluggable indexing backends much like the ORM supports various DB backends. This project utilizes `Whoosh`_ exclusively.\n * be simple enough to make \"**out of the box indexing**\" no harder than registering a
View gist:69233
#import <Python/Python.h>
int main(int argc, char *argv[])
{
PyObject *psrcstring, *pwriter_name_string, *pmodule, *pmethod, *presult;
PyTupleObject *pmethodargs;
PyDictObject *pmethodnamedargs;
char *output;
char *source = "Djoosh \n======\n\n`Djoosh`_ is a reusable django app which provides extensible, pure-python fulltext indexing for Django models using the `Whoosh`_ information-retrieval library. \n\nThe djoosh project lives at http://github.com/idangazit/djoosh/.\n\n.. _Djoosh: http://github.com/idangazit/djoosh/\n\n\nProject Goals\n-------------\n\nDjoosh will:\n \n * be a **pure-python** fulltext indexing solution. There are many fine solutions based around `Lucene`_ and `Solr`_ (java), or `Xapian`_ (C/C++). There is even one solution (`django-search`_) which provides pluggable indexing backends much like the ORM supports various DB backends. This project utilizes `Whoosh`_ exclusively.\n * be simple enough to make \"**out of the box indexing**\" no harder than registering a
View gist:76167
whatever.com (directory under source control)
|
|+ templates (django templates for this site)
|+ media (contains media, css, js, etc needed for this specific site)
|- project (the django project directory)
|- settings.py
|- urls.py
|+ app1
|+ app2
|+ env (the virtualenv directory, which isn't under source control via .gitignore or similar)
View gist:77592
def auth_return(request):
# this is the view which google returns the browser to after getting an authsub token
token = request.REQUEST['token']
request.session['token'] = token
return HttpResponseRedirect('/someotherview/')
def some_other_view(request):
token = session['token']
# .. use the token
View gist:77742
# import django-related bits, including my own form code from elsewhere
from django.http import HttpResponseRedirect, HttpResponseServerError
from django.shortcuts import render_to_response
from contacts_manager.forms import *
# importing the gdata stuff
from gdata.contacts.service import ContactsService
from gdata.alt.appengine import run_on_appengine
from gdata.auth import generate_auth_sub_url, extract_auth_sub_token_from_url
View gist:78142
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Sitewide Prefix {% block title %}{% endblock title %}</title>
<link rel="stylesheet" href="{{ MEDIA_URL }}css/reset.css" type="text/css" media="all" charset="utf-8">
<link rel="stylesheet" href="{{ MEDIA_URL }}css/960.css" type="text/css" media="all" charset="utf-8">
<link rel="stylesheet" href="{{ MEDIA_URL }}css/local.css" type="text/css" media="all" charset="utf-8">
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> -->
View gist:179730
def since(fn):
def decorated(self, request, **kwargs):
since = request.GET.get('since', None)
since_id = request.GET.get('since_id', None)
#if not since and not since_id:
# return fn(self, request, **kwargs)
if since and since_id:
# overconstrained
return rc.BAD_REQUEST
try:
View gist:179761
Hi Meni,
On Sep 2, 2009, at 5:25 PM, iCount Support wrote:
> As a human being I'd expect YOU to have learned that there is no reason to talk about something without knowing ANYTHING about it. As you clearly stated - you recommended iCount without actually testing it out first. You based your recommendations to your friends on anything but facts and treated our answer as BS - as if we were BSing our clients and sending them lies as answers.
>
Yes, I gave a 2nd-hand reccomendation for iCount without actually using it because I had heard it was good. Then, I agreed with my friend that your service is broken when it sends out passwords in plaintext.
So you'd prefer I don't recommend your service to friends? Or do you prefer I stick my head in the sand and not tell people that receiving cleartext passwords via email is a bad thing? Or you prefer that I not speculate as to what exactly is broken in your code/process when my friends get their password emailed to them, wide-open?
View gist:180233
#The decorated method's signature:
def read(self, request, band_id=None, slug=None)
#The original decorator:
def argcheck(fn_arg, get_param, argtype=None, required=True):
def wrap(f):
def decorated(self, request, *args, **kwargs):
arg = kwargs.get(fn_arg, None)
param = request.GET.get(get_param, arg)
# do stuff
You can’t perform that action at this time.