I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.
- Flask is managed by
uWSGI
. uWSGI
talks tonginx
.
// Get File | |
const getFileBtn = document.getElementById("fs-get") | |
getFileBtn.onclick = async () => { | |
const [handle] = await window.showOpenFilePicker(); | |
const file = await handle.getFile(); | |
console.log(file) | |
} | |
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:coup/firebase/auth.dart'; | |
import 'package:firebase_core/firebase_core.dart'; | |
import 'package:firebase_database/firebase_database.dart'; | |
class UserPresence { | |
static final _app = FirebaseApp.instance; | |
static final FirebaseDatabase _db = FirebaseDatabase( | |
app: _app, | |
databaseURL: 'https://coup-dc26b.firebaseio.com/', |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: Scaffold( |
[*.{js,jsx,ts,tsx,vue}] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
trim_trailing_whitespace = true | |
insert_final_newline = true | |
max_line_length = 100 | |
[*.{js,jsx,ts,tsx,vue}] | |
indent_style = space |
#!/bin/bash | |
raspivid -vf -n -w 640 -h 480 -o - -t 0 -b 2000000 | nc <your-pc's-ip> 5777 | |
# This is the code to be run on the raspberry-pi | |
# Your pc's IP is the client IP which you can get by ifcongif | |
# Make sure both of these devices are on the same network ex. Home Wifi | |
# 5777 is the port |
channelBookings({ state, commit }, user_id) { | |
var book = []; | |
db.collection("bookings").onSnapshot(res => { | |
const changes = res.docChanges(); | |
changes.forEach(change => { | |
switch (change.type) { | |
case "added": | |
book.push({ | |
...change.doc.data(), | |
id: change.doc.id |
from tkinter import * | |
import re | |
lista = ['i', 'went', 'through', 'executemany()', 'as', 'well', 'but', 'sorry', 'to', 'say', 'I', 'am', 'quite', 'new', 'to', 'both', 'python', 'and', 'sqlite.', 'My', 'doubt', 'is', 'like', 'if', 'I', 'have,', 'say', 'a', 'list', 'of', 'filenames', 'which', 'I', 'have', 'prepared', 'by', 'appending', 'values', 'inside', 'a', 'list', 'object,', 'then', 'how', 'can', 'I', 'use', 'it', 'with', 'executeMany..', 'is', 'it', 'like', 'simply', 'passing', 'the', 'list', 'object', '(say', 'fileList)', 'to', 'executemany()?..', 'Any', 'code', 'snippet', 'would', 'be', 'really', 'appreciated..', 'thanks'] | |
#Some Random crap, don't judge | |
class AutocompleteEntry(Entry): | |
def __init__(self, *args, **kwargs): | |
Entry.__init__(self, *args, **kwargs) |
# Hello | |
# Please read the comments for hints | |
import re | |
# These words have to be ignored even if they match | |
trash = ['tabs', 'inj', 'bottle', 'syp', 'bot', 'bott', 'cap', 'doses', 'with', 'ml', 'mg', 'in', 'methyl', 'containing', 'antibiotic', 'sodium', 'chloride', 'fluoride', 'phosphate', 'without', | |
'chloride', 'ammonium', 'citrate', 'adrenaline', 'gluconate', 'propionate', 'absorbent', 'unmedicated', 'sulphate', 'eye drops', 'lactate', 'disposable', 'lignocaine'] | |
# If two diffrent words from the same list are in the words, they become contradicting,and are thus not same. |
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |