Skip to content

Instantly share code, notes, and snippets.

@oshliaer
oshliaer / 70e04a67f1f5fd96a708.md
Last active August 5, 2023 09:22
Extract Gmail content to a spreadsheet #gas #gmail #sheet
@devStepsize
devStepsize / slack_webhook_post.py
Last active November 6, 2024 07:10
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@bekce
bekce / README.md
Created February 13, 2017 11:46
Node.js IMAP client with parsing

This example connects to an imap server and retrieves emails

npm install imap mailparser

@Saissaken
Saissaken / Update git fork with tags.sh
Last active November 12, 2024 02:24
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@ktmud
ktmud / parse_email.py
Created August 17, 2017 19:34
Python 3.6 Parse Email Message
import re
import email.charset
from pathlib import Path
from glob import glob
from email import message_from_binary_file, policy
RE_QUOPRI_BS = re.compile(r'\b=20=\n')
RE_QUOPRI_LE = re.compile(r'\b=\n')
RE_LONG_WORDS = re.compile(r'\b[\w\/\+\=\n]{72,}\b')
@thomassuckow
thomassuckow / ExtractEmailBodyText.java
Created November 10, 2017 16:30
Nifi Extract Email Body Text Processor
package foo;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import java.nio.charset.StandardCharsets;
import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
function YNABAccounts(accessToken, budgetId) {
const accounts = _getBudgetAccounts(accessToken, budgetId);
if(accounts == null) {
return null;
}
const columns = ["Name", "Type", "Budget", "Closed", "Balance"];
const rows = accounts.map(function (acc) {
return [
@sferich888
sferich888 / requests-saml.py
Last active January 13, 2023 06:59
Example SAML implementation using Python Requests
from requests.auth import AuthBase
class SAML(AuthBase):
from bs4 import BeautifulSoup
"""Implemeents SSO with RH auth.redhat.com"""
def __init__(self, username, password):
# setup any auth-related data here
self.username = username
self.password = password
@prasanthmj
prasanthmj / messages.html
Last active January 29, 2024 17:50
Parse and extract data from Gmail to Google Sheet. Read full article here: http://blog.gsmart.in/parse-and-extract-data-from-gmail-to-google-sheets/
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<title>Message Display Test</title>
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
</head>
<body style="padding:3em;">
<h1>Messages</h1>
<ul>
@terafin
terafin / UniFi USG DNS Redirect Setup.md
Last active April 19, 2024 21:40
UniFi USG DNS Redirect Setup
  1. Log into unifi controller web UI
  2. Go to Settings
  3. Select Routing & Firewall
  4. Select Firewall
  5. Select Groups
  6. Hit "Create new Group"
  7. Enter all your DNS servers here you want to be allowed on the local LAN (Eg, mine is 10.0.1.1 - gateway, 10.0.1.14 - pi-hole)
  8. Name this "Allowed DNS Servers"
  9. Hit OK
  10. SSH into the Gateway - NOT the CloudKey (username/password is whatever you set up)