Skip to content

Instantly share code, notes, and snippets.

@kofemann
kofemann / NettyGroupBenchmark.java
Last active October 30, 2022 05:21
Netty Event loop benchmark
package dev.kofemann.playground;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.epoll.EpollEventLoopGroup;
@cemerson
cemerson / archive.org-scanned-book-downloader-bookmarklet.md
Last active June 20, 2024 22:47
Archive.org Scanned Book Downloader Bookmarklet

Archive.org Scanned Book Downloader Bookmarklet

A simple "1-click" javascript approach to downloading a scanned book from archive.org to read at your leisure on the device of your choosing w/out having to manually screenshot every pages of the book by hand. In short it's a glorified "Save Image As..." approach but consolidated down to "1 click". BTW there may be a much better option than this out there - I just built this as an autistic project to see if it would work.

Demo Video

Archive.org SBDL Demo

Obligatory Legal/Disclaimer:

By using this script you agree to delete all book files/images after your 1 hour or 14 days is up! I don't support using this script for any other use cases. After all, none of us have ever kept a library book past it's return date, right?

@romain-grecourt
romain-grecourt / idea.gdsl
Created November 8, 2021 22:07
idea.gdsl
// see https://confluence.jetbrains.com/display/GRVY/Scripting+IDE+for+DSL+awareness
import com.intellij.lang.jvm.types.JvmReferenceType
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiClassObjectAccessExpression
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiElementVisitor
import com.intellij.psi.PsiMethod
import com.intellij.psi.PsiParameter
import com.intellij.psi.PsiQualifiedNamedElement
@maratori
maratori / golang-mocks.md
Last active June 7, 2024 18:26
Comparison of golang mocking libraries

Comparison of golang mocking libraries

Updated 2024-05-29

Uber
[gomock][6]
[testify][2] + [mockery][3] [minimock][4] [moq][5] Google
[gomock][1]

Library

GitHub stars [![s6]][6] [![s2]][2] + [![s3]][3] [![s4]][4] [![s5]][5] [![s1]][1]
Latest release date [![d6]][r6] [![d2]][r2] + [![d3]][r3] [![d4]][r4] [![d5]][r5] [![d1]][r1]
Maintained :white_check
@jrichardsz
jrichardsz / ClassScanner.java
Last active November 28, 2023 15:26 — forked from skempken/Detector.java
Find all annotated classes in a package using Spring
import java.lang.annotation.Annotation;
import java.util.LinkedList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.web.context.support.StandardServletEnvironment;
@israel-dryer
israel-dryer / message_finder.py
Created September 19, 2020 02:08
Identify undeliverable messages in Outlook
import re
import win32com.client as client
# pattern for identifying email addresses
pattern = re.compile(r'mailto:(\w+\.\w+@company.com)')
outlook = client.Dispatch('Outlook.Application')
namespace = outlook.GetNameSpace('MAPI')
inbox = namespace.Folders['Inbox']
@agungjk
agungjk / [slug].js
Last active April 7, 2024 15:22
Crawler example on Vercel using Puppeteer and NextJS API routes
const puppeteer = require('puppeteer-core');
const cheerio = require('cheerio');
const chrome = require('chrome-aws-lambda');
export default async (req, res) => {
const slug = req?.query?.slug;
if (!slug) {
res.statusCode = 200
res.setHeader('Content-Type', 'application/json')
res.end(JSON.stringify({ id: null }))
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active June 21, 2024 15:22
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@AlexPl292
AlexPl292 / .ideavimrc
Last active May 15, 2024 20:48
My `~/.ideavimrc` file
let mapleader=" "
""" Plugins --------------------------------
set surround
set multiple-cursors
set commentary
set argtextobj
set easymotion
set textobj-entire
set ReplaceWithRegister
@soomtong
soomtong / dot.ideavimrc
Last active April 20, 2023 06:57
Jetbrains ideavim plugin vimrc
"noremap j gj
"noremap k gk
" inoremap jk <ESC>
" map space as leader key
let mapleader=" "
nnoremap <SPACE> <Nop>
" find in path
nnoremap gj viw:action FindInPath<CR>