Skip to content

Instantly share code, notes, and snippets.

@anstosa
anstosa / SpamDigest.gs
Last active December 30, 2022 08:25
Daily Spam Digest for Google Apps Script
// Daily Spam Digest for Gmail.
// Creates a single digest email with deep links to any spam messages you received that day
// so you can easily check for false positives and retrieve them
// Usage:
// 1. Replace EMAIL with your email
// 2. Create trigger whenever you want to get the email
// 3. If you set your trigger for the morning, you likely want to edit the date settings so you don't miss any
function run() {
const EMAIL = 'username@gmail.com';
@bhtucker
bhtucker / upsert.py
Last active April 3, 2024 15:56
A demonstration of Postgres upserts in SQLAlchemy
"""
Upsert gist
Requires at least postgres 9.5 and sqlalchemy 1.1
Initial state:
[]
Initial upsert:
@joglomedia
joglomedia / mailwizz.dev.conf (MailWizz Nginx Configuration)
Last active November 9, 2022 22:17
MailWizz Nginx Configuration (Install using Simple LNMP Installer - https://github.com/joglomedia/deploy) - MailWizz EMA is a simple, efficient and full-featured email marketing application with an impressive features set. Download MailWizz here http://goo.gl/qDMd0I
server {
listen 80;
#listen [::]:80 default_server ipv6only=on;
## Make site accessible from world web.
server_name mailwizz.dev www.mailwizz.dev;
## Log Settings.
access_log /var/log/nginx/mailwizz.dev_access.log;
error_log /var/log/nginx/mailwizz.dev_error.log error;
@maartenbreddels
maartenbreddels / qt_and_tornado.py
Created October 1, 2015 10:57
Combining Qt and tornado, both which want to have their own event loop.
__author__ = 'breddels'
"""
Demonstrates combining Qt and tornado, both which want to have their own event loop.
The solution is to run tornado in a thread, the issue is that callbacks will then also be executed in this thread, and Qt doesn't like that.
To fix this, I show how to use execute the callback in the main thread, using a Qt signal/event in combination with Promises.
The output of the program is:
fetch page, we are in thread <_MainThread(MainThread, started 47200787479520)>
response is 191548 bytes, we are in thread <Thread(Thread-1, started daemon 47201018689280)>
the other thread should fulfil the result to this promise, we are in thread <Thread(Thread-1, started daemon 47201018689280)>
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@livibetter
livibetter / README.md
Last active June 25, 2018 05:00
Listing new trending repos on GitHub
@sloria
sloria / bobp-python.md
Last active June 26, 2024 15:54
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@fmariluis
fmariluis / config.fish
Created August 22, 2013 19:05
Basic configuration for Fish Shell
set -xg PYTHONPATH /opt/eleccion/ $PYTHONPATH
set -xg PYTHONPATH /opt/operaciones/ $PYTHONPATH
set -xg GOROOT /usr/local/go $GOROOT
set -xg PATH /usr/local/go/bin $PATH
set -xg EDITOR vim $EDITOR
setenv EDITOR vim
function l
ll $argv
@digitaljhelms
digitaljhelms / gist:4287848
Last active July 1, 2024 03:02
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@koblas
koblas / smtp.py
Created November 11, 2011 15:23
SMTP Client for Tornado
from tornado import ioloop
from tornado import iostream
import socket
class Envelope(object):
def __init__(self, sender, rcpt, body, callback):
self.sender = sender
self.rcpt = rcpt[:]
self.body = body
self.callback = callback