Skip to content

Instantly share code, notes, and snippets.

@saralgyaan
saralgyaan / auto_delete
Created January 12, 2019 09:44
This script auto deletes messages from your gmail inbox.
#!/usr/bin/python3.6
"""AutoDelete
This script auto deletes messages from your gmail inbox.
The perfect usecase is deleting the OTP messages received from banks after certain time period.
or deleting the messages received from certain services which doesn't have unsubscribe option.
Many parts of this script are copied from EZGmail by Al Sweigart (https://github.com/asweigart/ezgmail)
"""
@vinayak-mehta
vinayak-mehta / disease_outbreaks_camelot.ipynb
Last active June 27, 2024 15:36
A jupyter notebook showing how Camelot can be used to extract tables from PDFs scraped from the IDSP website.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hanspinckaers
hanspinckaers / .vimrc
Last active December 8, 2020 09:37
My full vimrc
syntax on
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree' " file list
Plug 'majutsushi/tagbar' " show tags in a bar (functions etc) for easy browsing
Plug 'vim-airline/vim-airline' " make statusline awesome
Plug 'vim-airline/vim-airline-themes' " themes for statusline
Plug 'jonathanfilip/vim-lucius' " nice white colortheme
Plug 'davidhalter/jedi-vim' " jedi for python
@flox1an
flox1an / default.conf
Last active September 1, 2023 07:26
nginx config that uses the oauth2-proxy (via auth_request) to authenticate against gitlab and then proxies all requests to a backend service while setting the auth headers X-User and X-Email
server {
listen 80;
server_name localhost;
location /oauth2/ {
proxy_pass http://oauth-proxy:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $request_uri;
# nginx proxy for Elasticsearch + Kibana
server {
listen 127.0.0.1:8080;
server_name your.domain.com;
# AWS DNS resolver (if you're running on AWS EC2, else use google DNS 8.8.8.8)
resolver 172.31.0.2;
# Fix nginx resolving url only on config load (AWS can change the endpoint IP at anytime)
@innovia
innovia / oauth2_proxy.cfg
Last active November 25, 2019 05:56
Bit.ly ouath2 proxy configuration
# IP address and port on which the proxy should listen for requests
http_address = "127.0.0.1:4181"
upstreams = [ "http://127.0.0.1:8080" ]
request_logging = true
client_id = "GOOGLE CLIENT ID"
client_secret = "GOOGLE CLIENT SECRET"
cookie_secret = "COOKIE SECRET"
pass_host_header=true
email_domains = [ "domain.com" ]
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active May 1, 2025 14:42
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@aunyks
aunyks / snakecoin-server-full-code.py
Last active May 19, 2025 01:22
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
@developius
developius / Dockerfile
Last active May 9, 2018 18:18 — forked from alexellis/Dockerfile
Sentiment Analysis function for FaaS
FROM python:2.7-alpine
RUN pip install textblob
RUN python -m textblob.download_corpora
ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin
RUN chmod +x /usr/bin/fwatchdog
WORKDIR /root/
COPY handler.py .
@ajdavis
ajdavis / watcher.py
Created January 4, 2017 13:14
Script based on the Python "watchdog" module to run tasks when files change.
#!/usr/bin/env python
import os
import re
import threading
import time
import subprocess
from os.path import splitext, expanduser, normpath
import click