This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am paulorsbrito on github. | |
* I am paulobrito (https://keybase.io/paulobrito) on keybase. | |
* I have a public key ASAGNgzDqklvxmkkzTBRAevy_L2AJYz5aetk3IG_rPiyGwo | |
To claim this, I am signing this object: |
This file contains 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
/** | |
* Clone an object removing Firestore's stuffs from it (ES7) | |
* | |
* @param {Object} obj - obj to work on | |
* @param {Array} ignoredProps - Additional props to ignore (always ignores "ref") | |
*/ | |
export function unfirebased(obj, ignoredProps = []) { | |
ignoredProps = [...ignoredProps, 'ref'] |
This file contains 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 { stringify } from 'query-string'; | |
import { | |
GET_LIST, | |
GET_ONE, | |
GET_MANY, | |
GET_MANY_REFERENCE, | |
CREATE, | |
UPDATE, | |
DELETE, | |
} from 'admin-on-rest'; |
This file contains 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
# -*- coding: utf-8 -*- | |
from django.utils.html import strip_tags | |
from haystack.utils import Highlighter | |
from whoosh.analysis import CharsetFilter, RegexTokenizer | |
from whoosh.support.charset import accent_map | |
""" | |
This custom django-haystack highligther apply Whoosh's ChartsetFilter to both | |
the keyword and the text, so a keyword 'café' gets highlighted on a text |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
This is a fork of Greg's gist, which allows use of character folding with haystack and whoosh. What | |
I've done was to add allow EdgeNGram fields to be folded. This is useful if you're using autocomplete | |
or just indexing text as EdgeNGram field to allow partial keywork search. Thanks, Greg. Have fun. | |
-+- original comments -+ | |
https://gist.github.com/gregplaysguitar/1727204 |