Skip to content

Instantly share code, notes, and snippets.

View pierremonico's full-sized avatar

Pierre Monico pierremonico

View GitHub Profile
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 29, 2024 17:57
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brennanneoh
brennanneoh / README.md
Last active May 20, 2023 21:02
Anet A8 Printer Profile

Setup

  1. Install Cura 2.4
  2. Copy anet_a8.def.json to /Applications/Cura.app/Contents/Resources/resources/definitions
  3. Open Cura
  4. Expand Custom, then select Anet A8
  5. Click Finish
@devStepsize
devStepsize / slack_rtm_client.py
Last active July 9, 2018 15:14
Use Slack's Real Time Messaging API with Python and python-slackclient
'''
This is an example of how to use the Slack Real Time Messaging API using
Python and the python-slackclient.
The example below originates from the python-slackclient documentation.
See https://github.com/slackhq/python-slackclient#real-time-messaging
This is everything you can do with the client:
Connect to a Slack RTM websocket. This is a persistent connection from which you can read events.
@mikejolley
mikejolley / gist:3b37b9cc19a774665f31
Last active April 21, 2023 12:44
Example instance based shipping method
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Sample instance based method.
*/
class WC_Shipping_Test_Method extends WC_Shipping_Method {

Build a scalable Twitter clone with Django and GetStream.io

In this tutorial we are going to build a Twitter clone using Django and GetStream.io, a hosted API for newsfeed development.

We will show you how easy is to power your newsfeeds with GetStream.io. For brevity we leave out some basic Django-specific code and recommend you refer you to the Github project for the complete runnable source code. At the end of this tutorial we will have a Django app with a profile feed, a timeline feed, support for following users, hashtags and mentions.

I assume that you are familiar with Django. If you're new to Django the [official tutorial] (https://docs.djangoproject.com/en/2.0/intro/) explains it very well.

# This is a really old post, in the comments (and stackoverflow too) you'll find better solutions.
def find(key, dictionary):
for k, v in dictionary.iteritems():
if k == key:
yield v
elif isinstance(v, dict):
for result in find(key, v):
yield result
elif isinstance(v, list):
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong