Skip to content

Instantly share code, notes, and snippets.

View PavlikPolivka's full-sized avatar

Pavel Polívka PavlikPolivka

View GitHub Profile
@PavlikPolivka
PavlikPolivka / unfollow.py
Last active December 3, 2024 13:47
SkyBlue cleanup script to unfollow inactive accounts. Fill in your handle and app password and run it like python unfollow.py --prod --days 15. It will unfollow all acounts that were not active in last 15 days.
from datetime import timezone
from atproto import Client
import datetime
client = Client()
handle = 'YOUR_HANLDE'
password = 'YOUR_APP_PASSWORD'
client.login(handle, password)
import TextField from '@mui/material/TextField';
import Button from '@mui/material/Button';
import {useState} from 'react';
export default function Contact() {
const [send, setSend] = useState(false);
async function handleSubmit(event) {
event.preventDefault()
const sendInBlueKey = process.env.NEXT_PUBLIC_SEND_IN_BLUE_KEY
export default async function handler(req, res) {
const body = req.body
const resp = await fetch('https://api.sendinblue.com/v3/smtp/email', {
method: 'POST',
headers: {
'Accept': 'application/json',
import ReactMarkdown from 'react-markdown';
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { materialDark } from "react-syntax-highlighter/dist/cjs/styles/prism";
import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";
<ReactMarkdown
components={{
p: ({ node, children }) => {
if (node.children[0].tagName === "img") {
const image = node.children[0];
[functions]
included_files = ["netlify/functions/**"]
{
"scripts": {
"generate": "run-func netlify/functions/header.js handler"
},
"dependencies": {
"axios": "^0.24.0",
"jimp": "^0.16.1",
"rss-to-json": "^2.0.2",
"run-func": "^1.0.5",
"sharp": "^0.29.3",
const { TwitterClient } = require('twitter-api-client')
const axios = require('axios')
const sharp = require('sharp')
const Feed = require('rss-to-json')
const Jimp = require('jimp')
const fs = require('fs')
const numberOfFollowers = 3
const widthHeightFollowerImage = 90
getDataCached('a').then(result => { console.log('first call outer: ' + result);
getDataCached('a').then(result => { console.log('first call inner: ' + result); });
});
getDataCached('b').then(result => { console.log('first call outer: ' + result);
getDataCached('b').then(result => { console.log('first call inner: ' + result); });
});
getDataCached('a').then(result => { console.log('second call outer: ' + result);
getDataCached('a').then(result => { console.log('second call inner: ' + result); });
const now = new Date().getTime();
if (_cacheResolvedTime.has(key)) {
if ((now - _cacheResolvedTime.get(key)) > 60000) {
_cacheResolvedTime.delete(param);
_cacheValues.delete(key);
_cachePromises.delete(key);
}
}
if (_cacheValues.has(key)) {
return Promise.resolve(_cacheValues.get(key));
} else if (_cachePromises.has(key)) {
return _cachePromises.get(key);
} else {
const promise = new Promise(function (resolve, reject) {
return getData(key).then(data => {
_cacheValues.set(key, data);
_cachePromises.delete(key);
const now = new Date().getTime();