⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Optional, List, Dict, Union | |
from fastapi import FastAPI, Query, Header, Cookie, Depends, HTTPException, status | |
from fastapi.responses import JSONResponse | |
from pydantic import BaseModel, validator | |
import re # For email validation | |
app = FastAPI() | |
# --- Helper Functions (Simplified for demonstration) --- | |
# Replace these with your actual helper function implementations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Consensus Statements: | |
- Climate change requires immediate action (strong agreement) | |
Divisive Statements: | |
- Nuclear power is necessary for clean energy | |
- Carbon tax should be implemented globally | |
- Individual actions matter for sustainability | |
- Companies should be held liable for emissions | |
Group Positions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intelligent large language models like OpenAI's GPT-3 can be used to improve Pol.is in several ways, enhancing the platform's capabilities and user experience. Here are some potential improvements: | |
1. Statement generation: Language models can generate high-quality, relevant, and diverse statements or questions based on the conversation topic. This can help stimulate more engaging and informative discussions among participants. | |
2. Summarization: Language models can automatically summarize conversation threads, identifying key points and areas of agreement or disagreement. This can make it easier for users to understand the overall flow of the conversation and track its progress. | |
3. Sentiment analysis: Language models can analyze the sentiment of participants' responses, providing insights into the emotional tone of the conversation. This can help organizers identify potential areas of contention or support and address them more effectively. | |
4. Moderation: Language models can help in automating content mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ grep -P "^[ABCDEFabcdefOoIi]{6,6}$" /usr/share/dict/words | tr 'OoIi' '0011' | tr '[:lower:]' '[:upper:]' | awk '{print "#" $0}' | |
#ACAD1A | |
#B0BB1E | |
#DEBB1E | |
#AB1DED | |
#ACAC1A | |
#ACCEDE | |
#AC1D1C | |
#BAB1ED | |
#BA0BAB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To use: change gmail's settings to: | |
# enable imap: | |
# Gmail Settings | |
# Forwarding and POP/IMAP | |
# create an app password | |
# App passwords | |
# https://myaccount.google.com/security | |
set imap_login = "" | |
set imap_pass = "XXXXXXXXXXXXXXXX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
from fbchat import log, Client | |
# Subclass fbchat.Client and override required methods | |
class FBListener(Client): | |
def onMessage(self, author_id, message_object, thread_id, thread_type, **kwargs): | |
self.markAsDelivered(thread_id, message_object.uid) | |
self.markAsRead(thread_id) |
For lots of reasons (expand).
To address this, in the community it is often proposed to have a list of resources or existing projects. While an obvious solution, it has several fundamental challenges, such as:
- It is hard for one or a small group of people to know everything that is going on
- Someone has to maintain this resource or else relevance slowly declines and leads to stagnation
We prefer to have audit logging in our services that leverage databases. It gives us clarity into sources of where ACL issues might originate as well as gives us a general timeline of activity in our application.
Audit logging is tedious to set up so this gist contains our latest iteration of audit logging support for a sequelize based service.
NewerOlder