Skip to content

Instantly share code, notes, and snippets.

@revdfdev
revdfdev / delete_email.py
Created January 2, 2022 22:12 — forked from giovaneliberato/delete_email.py
Python script to delete emails from a specific sender at gmail
#coding: utf-8
import imaplib
import sys
'''
Simple script that delete emails from a given sender
params:
-username: Gmail username
-pw: gmail pw
-label: If you have a label that holds the emails, specify here
@revdfdev
revdfdev / gist:8d66b2e354dc53c050271de662fec85c
Created August 30, 2021 19:01 — forked from jazlalli/gist:6510962
Example of a node-amqp subscriber with dead lettering
var amqpconnection = amqp.createConnection({url: config.CLOUD_AMQP}, connOptions);
amqpconnection.on('ready', function() {
// dead letter exchange for rejected messages
amqpconnection.exchange(
deadLetterExchange,
options = {durable: true, autoDelete: false, type: 'topic'},
function (ex) {
@revdfdev
revdfdev / auth-hook.js
Created December 28, 2020 19:31 — forked from ulises-jeremias/auth-hook.js
Examples of hooks utils using axios, recoil.js, keycloak-js, @react-keycloak/web and more.
import { useCallback, useEffect, useState } from 'react';
import { useSetRecoilState } from 'recoil';
import { useKeycloak } from '@react-keycloak/web';
import { commonNotification } from './common';
/**
* Returns the auth info and some auth strategies.
*
*/
@revdfdev
revdfdev / auth-hook.js
Created December 28, 2020 19:31 — forked from ulises-jeremias/auth-hook.js
Examples of hooks utils using axios, recoil.js, keycloak-js, @react-keycloak/web and more.
import { useCallback, useEffect, useState } from 'react';
import { useSetRecoilState } from 'recoil';
import { useKeycloak } from '@react-keycloak/web';
import { commonNotification } from './common';
/**
* Returns the auth info and some auth strategies.
*
*/
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.default {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.default {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.default {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.default {