Code Monkey home page Code Monkey logo

comfortbutton's Introduction

Comfort Button

Made with ♥ by Arjun Bhatnagar

This project is a self-contained flask project that launches ngrok and is able to open a file/url when a page is hit. The goal is to launch a video to calm me down when I have an anxiety or panic attack, or when I am absolutely miserable.

My fiancé passed away recently and life has been so difficult. Every day is so tough and I have lost all joy in life. The only times I have smiled for more than a few seconds are when I see my love. She was so pure, beautiful, and wonderful. --Arjun Bhatnagar

The project accompanies a physical "comfort button" created by my friend [Nicholas Francisci] Nick. The button contains a "photon" board that sends a web request to the flask server running.

N|Solid N|Solid

Installation

Download the project from Github.

$ git clone https://github.com/acenario/ComfortButton

Comfort Button requires ngrok added to path, or for it to be in your directory.

Download and extract the latest version of ngrok and add it to PATH.

Or run these commands (Mac & Linux Users) where you downloaded ngrok.

$ unzip path/to/ngrok.zip
$ cp ngrok /usr/local/bin/ngrok

You can either install in a virtualenv or install globally. You can also checkout the venv branch if you do not want to install virtualenv.

$ cd ComfortButton
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
$ python manage.py startbutton

You will be asked some configuration details, leave the defaults but change the subdomain to match the configured ComfortButton's url.

Interesting Features

This project has some interesting classes that I wrote. I wrote a self-contained ngrok manager and hooked any flask request to open either a file or a url.

I wrote some commands to go along with the classes and can be run independently.

Running the main project

$ python manage.py startbutton

Running just the flask server

$ python manage.py runserver

Running just ngrok tunnel

$ python manage.py startngrok

Opening the configured video/file

$ python manage.py openvideo

Manually killing existing ngrok processes

$ python manage.py killngrok

Example Config

When you run for the first time, it will generate a config. Here is a sample config.

[ngrok]
active = False
current_url = none
use_config = False 
tunnel = http
port = 5000 
auth = none 
subdomain = arjunandira 

[button]
primary_video = http://www.yourepeat.com/watch?v=99td8AsSkfQ

comfortbutton's People

Contributors

acenario avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.