Skip to content

Instantly share code, notes, and snippets.

View schlos's full-sized avatar

Miroslav schlos

View GitHub Profile
@schlos
schlos / README.md
Created June 2, 2015 14:26
No name

README is empty

@schlos
schlos / InsertDate.gs
Last active August 29, 2015 14:26 — forked from thomxc/InsertDate.gs
Google Docs Script Macro: Insert Date
/**
* The onOpen function runs automatically when the Google Docs document is
* opened. Use it to add custom menus to Google Docs that allow the user to run
* custom scripts. For more information, please consult the following two
* resources.
*
* Extending Google Docs developer guide:
* https://developers.google.com/apps-script/guides/docs
*
* Document service reference documentation:
@schlos
schlos / MailinatorAliases
Created October 20, 2015 07:40 — forked from nocturnalgeek/MailinatorAliases
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@schlos
schlos / cf-ddns.sh
Created January 2, 2016 13:33 — forked from larrybolt/cf-ddns.sh
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
@schlos
schlos / cloudflare.php
Created January 3, 2016 13:29 — forked from gentlecat/cloudflare.php
CloudFlare DNS records updater
<?php
/**
* Settings
*/
define('API_KEY', $_GET['apikey']); // CloudFlare API key
define('USERNAME', 'user@example.com'); // Email address used to login into CloudFlare
define('IP', getCurrentIP()); // Current IP address
echo 'Setting IP address to "' . IP . '"...<br />';

Keybase proof

I hereby claim:

  • I am schlos on github.
  • I am schlossy (https://keybase.io/schlossy) on keybase.
  • I have a public key ASBgfFRZjINgtFmiZf9e7WsFNzCFf23srdG_u6sxMAsgEQo

And finally, I am proving ownership of the github account by posting this as a gist.

function gmailAutoarchive() {
var delayDays = 2; // will only impact emails more than 48h old
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time?
// Get all the threads labelled 'autoarchive'
var label = GmailApp.getUserLabelByName("autoarchive");
var threads = label.getThreads(0, 400);
@schlos
schlos / DelayGmail
Created June 16, 2017 14:47 — forked from donalod/DelayGmail
GoogleAppScript_DelayedEmail
function moveDelayedMessages() {
receiveEmails("Delayed Messages");
Utilities.sleep(60000);
reArchive();
}
// receiveEmails() will take all threads in labelname (Default: 'Delayed messages')
// and place them into the mailbox. The intent is for a delayed retrieval of
// messages when combined with a script timer.
function receiveEmails(labelName) {
@schlos
schlos / gmailDelayed.js
Created June 16, 2017 14:49 — forked from pawurb/gmailDelayed.js
Fighting email checking addiction ...
//TODO
//https://developers.google.com/apps-script/managing_triggers_programmatically
function moveDelayedMessages() {
receiveEmails("Delayed Messages");
}
// receiveEmails() will take all threads in labelname (Default: 'Delayed messages')
// and place them into the mailbox. The intent is for a delayed retrieval of
@schlos
schlos / gist:d5fbe61440f6973dc400a4e70a1843de
Created June 16, 2017 15:44 — forked from jceresearch/gist:5755030
Google Apps Script to create a digest from a set of messages in Gmail. It does a bit more than that, filters by time, strips the html, trims legalese (or whatever) and tags messages so they are not processed again. Ideal to schedule it in gmail.
function GenerateDigest() {
//Function that goes through a search query based on time and optional label in gmail, strips html, collates into a single email, sends it to a desired address and then labels the emails as processed.
// Where the digest email is going
var to_emailAddress = "tomail@somedomain.com";
//We calculate the 24 hour range, I plan to run this every day at 9:00 to get last 24 hours of emails
var month = new Date().getMonth();