Skip to content

Instantly share code, notes, and snippets.

View alexanderankin's full-sized avatar

David Ankin alexanderankin

View GitHub Profile
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Gobblet {
public static void main(String[] args) {
Game game = new Game();
@alexanderankin
alexanderankin / Skip-tests-on-NPM.md
Created November 8, 2022 20:02
How to disable tests on NPM

Skip tests on NPM

first, we will create a sample project:

mkdir ~/skip-tests-npm-demo
cd ~/skip-tests-npm-demo
/*
* Copyright 2017 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@alexanderankin
alexanderankin / chromium-debian-on-ubuntu.md
Last active November 12, 2022 05:52
how to run debian chromium on ubuntu

how to install chromium

todo: verify solution instructions

problem:

when you install chromium on ubuntu, it does not see the /tmp folder, breaking software such as.

solution

import lombok.Data;
import lombok.experimental.Accessors;
import reactor.core.publisher.Mono;
public class SideOrPure {
public static void main(String[] args) {
sideApproach().doOnNext(System.out::println).blockOptional();
pureApproach().doOnNext(System.out::println).blockOptional();
}
@alexanderankin
alexanderankin / index.html
Last active August 29, 2022 10:52
inside html tag
<!doctype html>
<html lang="en-us">
<head>
<meta chaset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>About me</title>
</head>
<body>
<section>
<p>some content here</p>
public class Example {
public static void main(String[] args) {
HasSetters hasSetters = new HasSetters().setId("abc").setData(1);
HasWith hasWith = new HasWith(null, 0).withId("abc").withData(1);
}
public static class HasSetters {
String id;
int data;
package pkg;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import java.util.function.Consumer;
@SuppressWarnings("ReactiveStreamsPublisherImplementation")
public class InterceptedPublisher<T> implements Publisher<T> {
private final Publisher<T> publisher;
import { MongoClient } from "mongodb";
const uri = "mongodb://localhost";
async function insertSampleData() {
const client = new MongoClient(uri);
try {
const database = client.db("tj08-17-22");
const saleCollection = database.collection("sale");
@alexanderankin
alexanderankin / node-thread-pool.js
Last active August 5, 2022 13:59
how to throttle requests in node
let levels = {
error: 200,
warn: 300,
info: 400,
debug: 500,
trace: 600,
}
let level = levels['info'];
function noop() {