Skip to content

Instantly share code, notes, and snippets.

View AparaV's full-sized avatar
🌴
On vacation

Apara Venkat AparaV

🌴
On vacation
View GitHub Profile
@AparaV
AparaV / streamer.py
Last active July 22, 2021 16:22
Using the tweepy library to stream tweets has a catch. There is no built-in feature that allows you to stop streaming after a fixed time. To avoid manually terminating the stream, this code proposes a simple solution without any (complex) multi-threading.
import os
import time
import tweepy
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy import StreamListener
def authenticate():
@mars
mars / create-react-app-on-heroku.sh
Created July 29, 2016 01:12
Create a React app & deploy to Heroku
## Global install of the app generator
npm install -g create-react-app
## Setup the app (first-time only)
create-react-app my-app
cd my-app
git init
# Create the Heroku app; requires free account at https://www.heroku.com/
heroku create -b https://github.com/heroku/heroku-buildpack-static.git
@Phlow
Phlow / for-loop-sorted-collection
Last active December 8, 2023 07:28
This Liquid loop for Jekyll sorts a collection by date in reverse order
{% comment %}
*
* This loop loops through a collection called `collection_name`
* and sorts it by the front matter variable `date` and than filters
* the collection with `reverse` in reverse order
*
* To make it work you first have to assign the data to a new string
* called `sorted`.
*
{% endcomment %}