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
(load "~/.emacs.d/flymake.el") | |
(load "~/.emacs.d/flymake-cursor.el") | |
; manual python checking: | |
; pycheckers is a script in the path, under ~/bin/, that run | |
; pyflakes, pep8 and possibly more checks | |
(setq python-check-command "/Users/erwan/bin/pycheckers") | |
; use flymake with pycheckers | |
(add-hook 'find-file-hook 'flymake-find-file-hook) |
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
#!/bin/bash | |
flake8 --ignore=E221,E701,E202,E501,E302,E301 $@ | |
# Return true | |
true |
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
brew install python3 | |
brew install flake8 |
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
# Use vision api to extract all text in the image | |
response = gvc.annotate_image({ | |
'image': { | |
'source': { | |
'image_uri': 'gs://%s/%s' % (bucket_name, IMG_NAME), | |
} | |
}, | |
'features': [ | |
{ | |
'type_': vision.Feature.Type.DOCUMENT_TEXT_DETECTION, |
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
renderer = PageRenderer() | |
pdf_document = load_from_file(pdf) | |
emails = [] | |
for page_number in range(pdf_document.pages): | |
page = pdf_document.create_page(page_number) | |
image = renderer.render_page(page) | |
# Convert pdf image to PIL image |
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
{ | |
"timestamp": "2020-11-28T04:11:40.530Z", | |
"eventId": "string", | |
"eventType": "MESSAGE_ADDED", | |
"message": { | |
"messageId": "string", | |
"chatId": "string", | |
"parentId": "string", | |
"isRead": true, | |
"type": "USER", |
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
{ | |
"user_id": "user-123", | |
"chat_id": "chat-456", | |
"thread_id": "branch-abc", | |
"date_created": "2020-11-28 13:15:09+00:00", | |
"date_last_seen": "2020-11-30 08:26:11+00:00", | |
"is_muted": false, | |
"is_active": true, | |
} |
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
{ | |
"user_id": "user-123", | |
"chat_id": "chat-123456", | |
} | |
{ | |
"user_id": "user-123", | |
"chat_id": "chat-789012", | |
} |
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
class Message(): | |
def normalize(self): | |
# If message lacks a 'likes' counter, initialize one | |
if not hasattr(self, 'count_likes'): | |
self.count_likes = 0 | |
# Each time you are fetching a message from datastore, do | |
# something like: | |
msg = fetch_from_database(message_id) |
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
{ | |
"message_id": "1234567890", | |
"chat_id": "chat-123", | |
"thread_id": "branch-789", | |
"author_id": "user-456", | |
"type": "TEXT", | |
"text": "this is a message", | |
"image_url": null, | |
"count_views": 99, | |
"count_likes": 22, |
NewerOlder