Skip to content

Instantly share code, notes, and snippets.

@tg44
tg44 / AdaptiveQueueSource.scala
Created April 29, 2021 10:17
AdaptiveQueueSource akka streams extension
package akka.streams
import akka.Done
import akka.stream.OverflowStrategies.{Backpressure, DropBuffer, DropHead, DropNew, DropTail, Fail}
import akka.stream.{
Attributes,
BufferOverflowException,
Outlet,
OverflowStrategy,
QueueOfferResult,
@tg44
tg44 / Bootstrap.scala
Last active May 11, 2021 14:45
Crowdin CDN from Play framework
import play.api.inject.Module
import helpers.{MessagesApiWithCrowdin, MessagesApiWithCrowdinProvider}
import play.api.i18n.{DefaultLangsProvider, Langs, MessagesApi}
import play.api.inject.Binding
import play.api._
//possibly some imports are missing
class AppStartModule extends Module {
override def bindings(environment: Environment, configuration: Configuration): Seq[Binding[_]] = {
Seq(
@tg44
tg44 / linkchecker.js
Created June 5, 2021 07:25
Vuepress broken link checker
const path = require( 'path' );
const express = require( 'express' );
const app = express();
const blc = () => {
let err = 0
const blc = require('broken-link-checker')
const siteChecker = new blc.SiteChecker({}, {
robots: function(robots, customData){},
@tg44
tg44 / mustacheSchema.test.ts
Last active February 23, 2023 15:07
JsonSchema generation from {{ mustache }} templates
import Ajv from "ajv";
import { describe, expect, test } from "@jest/globals";
import { schemaGenFromMustacheTemplate } from "./mustacheSchema";
interface TestGen {
name: string;
template: string;
schema: Record<string, any>;
expectedError: string | null;
}