Skip to content

Instantly share code, notes, and snippets.

@floriangosse
floriangosse / Gmail - Mark Issue Mails from Sentry as important.gs
Created April 22, 2024 07:56
[Google Apps Scripts] Gmail: Mark Issue Mails from Sentry as important
function run() {
while (true) {
const threads = GmailApp.search('{from:@getsentry.com from:@*.getsentry.com} -is:important ', 0, 100);
const importantThreads = threads.filter(function (thread) {
const messages = thread.getMessages();
return messages.some(function (message) {
return !!message.getHeader('X-Sentry-Project');
});
});
@floriangosse
floriangosse / Gmail - Mark archived as read.gs
Last active April 22, 2024 07:57
[Google Apps Script] Gmail: Mark archived as read
function markArchivedAsRead() {
var threads = GmailApp.search('label:unread -label:inbox');
GmailApp.markThreadsRead(threads);
};
@floriangosse
floriangosse / Gmail - Auto-Archive.gs
Last active April 22, 2024 07:56
[Google Apps Script] Gmail: Auto-Archive
var LABEL = 'Auto-Archive';
var OLDER_THEN = '2d';
function archiveIfHasLabelAndOlderEnough() {
var label = GmailApp.getUserLabelByName(LABEL);
// Get all threads which are labeled for auto archive
var threads = GmailApp.search('label:inbox label:' + LABEL + ' older_than:' + OLDER_THEN);
// Process threads
import { chromium } from 'playwright';
async function main() {
const browser = await chromium.launch({
headless: false,
});
const page = await browser.newPage();
await page.goto('https://www.google.com');
import * as postcss from "postcss";
export default postcss.plugin("postcss-output-class-names", (options = {}) => {
// Work with options here
return root => {
const classNamePattern = /\.-?[_a-zA-Z]+([_a-zA-Z0-9-]|\\:)*/g;
let selectors = [];
// Transform CSS AST here
root.walkRules(rule => {
@floriangosse
floriangosse / toolbelt.scss
Last active November 20, 2018 14:52
Collection of useful functions for SCSS
//
// String
//
@function str-trim($string) {
$start: 1;
$end: str-length($string);
@for $i from 1 through str-length($string) {
$first: str-slice($string, $i, $i);
@floriangosse
floriangosse / Todo.txt - Path Filters.md
Created May 28, 2018 07:44
Get todos for specific directory

Todo.txt – Path Filters

Get todos for specific directory

Configuration

Configure filters for paths in ~/.todo/path-filters:

FILTERS_PER_PATH[~/private/super-secret]="+super-secret"
FILTERS_PER_PATH[~/project/customer-01]="+customer-01"
@floriangosse
floriangosse / console.log
Created January 18, 2017 09:35
Browserstack error (2017-01-18)
2017-01-18 10:33:34.261 livejs-20170117151132.js:11 TypeError: $(...)[0].amIConnected is not a function
at livejs-20170117151132.js:11
@floriangosse
floriangosse / git.migrate
Last active October 18, 2016 07:19 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.

Keybase proof

I hereby claim:

  • I am floriangosse on github.
  • I am floriangosse (https://keybase.io/floriangosse) on keybase.
  • I have a public key whose fingerprint is E413 2D21 02FD D6F6 AA95 7345 511A 574A D63B F57F

To claim this, I am signing this object: