Skip to content

Instantly share code, notes, and snippets.

View mvgolom's full-sized avatar

Marcos Golom mvgolom

  • campo mourao
View GitHub Profile
@frfahim
frfahim / install virtualenv ubuntu 16.04.md
Last active May 20, 2024 06:45
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@huiliu
huiliu / app.py
Created December 8, 2015 17:12
Flask Streaming from Templates
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, stream_with_context, request, Response, flash
from time import sleep
app = Flask(__name__)
def stream_template(template_name, **context):
@metaphorical
metaphorical / Mint-shortcut-VSCode.md
Last active March 16, 2023 12:17
Add shortcut to Application menu in Linux Mint

#Add shortcut to Application menu in Linux Mint

Example will be setting up VS Code on Mint and add shortcut to menu and panel.

Actually, it is really easy, you can just download ir from website, unzip in desired folder and run from there, so this is just about a way to add shourtcut where you want it.

##Download

https://code.visualstudio.com/Download

@blixt
blixt / flask_cors.py
Created August 16, 2014 18:24
How to add CORS support to a Flask app in 9 lines of code
def add_cors_headers(response):
response.headers['Access-Control-Allow-Origin'] = '*'
if request.method == 'OPTIONS':
response.headers['Access-Control-Allow-Methods'] = 'DELETE, GET, POST, PUT'
headers = request.headers.get('Access-Control-Request-Headers')
if headers:
response.headers['Access-Control-Allow-Headers'] = headers
return response
app.after_request(add_cors_headers)