Skip to content

Instantly share code, notes, and snippets.


BBB yxy

  • gggg
View GitHub Profile
import aiohttp
def request_tracer(results_collector):
Provides request tracing to aiohttp client sessions.
:param results_collector: a dict to which the tracing results will be added.
:return: an aiohttp.TraceConfig object.
docPhil99 /
Last active Jan 31, 2021
Mac webcam FFmpeg

#Capture and stream a webcam To capture using the iSight camera on a Mac, or infact any other webcam connected to the Mac, we can use FFmpeg. First get a list of the devices installed.

ffmpeg -f avfoundation -list_devices true -i "" 

This will list the aviable video and audio devices.

The below will capture at 30fps and the set video size to a file. ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -i "0:none" out.avi

luke14free /
Last active Oct 26, 2016
Simple type checked objects in Python
#!/usr/bin/env python
from type_checked_entities import entity_factory
Giraffe = entity_factory( # let's define what is a giraffe!
name=str, # my name is a string
age=float, # my age is an int
eats=object, # I eat pretty much everything.
tbarbugli / How to build a notification
Last active Nov 22, 2020 — forked from tschellenbach/
How to build a notification feed using Stream
View How to build a notification

How to build a notification feed using Stream


In this tutorial we are going to show how easy it is to build a notification feed using First of all, let's quickly introduce you to our fictional example app. It's called and allows you interact with your friends, ping them, follow them or poke them. Here's a quick list of example interactions:

  • poke another user (eg. Thierry pokes Alessandra)
  • follow a user (eg. Tommaso follows Iris)
  • ping a user (eg. Josie pings Carolina)

Whenever a user is part of one of these interactions, we want to update his notification feed, update the number of unseen and unread

ssinss /
Last active Jan 20, 2021
Endless RecyclerView OnScrollListener
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;