This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WARN WARN - this sample introduce some issue as #2757 is talking about : Event blockUpdate:(x, y, z) did not fire within timeout of 5000ms | |
// use FIXED version below instead of this | |
export const isAirBlock = b => b && b.name === 'air'; | |
/** | |
* Find a clear position dégagée next to the bot to place a bloc. | |
* @param {Bot} bot - Mineflyer Bot Instance | |
* @param {number} range - Around bot max range to explore. | |
* @returns {pos} - A valid position or null if no one is found. | |
*/ | |
export const findClearPosition = (bot, range = 3) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany; | |
import static java.util.concurrent.Executors.newFixedThreadPool; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Future; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.company.interceptors; | |
import java.io.IOException; | |
import java.net.URI; | |
import lombok.NonNull; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.http.HttpRequest; | |
import org.springframework.http.client.ClientHttpRequestExecution; | |
import org.springframework.http.client.ClientHttpRequestInterceptor; | |
import org.springframework.http.client.ClientHttpResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/umami-software/website/issues/191 | |
// https://umami.is/docs/api/node-client | |
import umami from "@umami/node"; // https://www.npmjs.com/package/@umami/node | |
const hostUrl = "https://cloud.umami.is"; | |
const websiteId = process.env.UMAMI_WEBSITE_ID || false; // umami instance id | |
const websiteDomain = process.env.UMAMI_WEBSITE_DOMAIN || "myapp.example.com"; | |
if (!websiteId) { | |
throw new Error('Please set UMAMI_WEBSITE_ID env'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list them all : [F8] then [2] | |
# alphanum order ASC | |
_hi | |
_gg | |
_gn3 | |
_nice3 | |
aaa | |
aaaa | |
air | |
ban? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from: https://github.com/boly38/botEnSky/issues/57 | |
// ---------------------------- | |
// ReST API to detect bird - from blog : https://blog.roboflow.com/bird-detection-api/ | |
// *** this file is doing identification of a target folder containing 1..N files having "JPG" as extension | |
import axios from 'axios'; | |
import fs from 'fs'; | |
import path from 'path'; | |
import {fileURLToPath} from 'url'; | |
const __filename = fileURLToPath(import.meta.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// gist : https://gist.github.com/boly38/5752000289342895a6008e53df2c6c9f | |
// from: https://github.com/boly38/botEnSky/issues/57 | |
// ---------------------------- | |
// ReST API to detect bird - from blog : https://blog.roboflow.com/bird-detection-api/ | |
// API_KEY - REQUIRED - export ROBOFLOW_API_KEY=xxxx | |
// https://app.roboflow.com / use public plan free and get your api key under profile | |
const api_key = process.env["ROBOFLOW_API_KEY"] || "unauthorized"; | |
// bird v2 public dataset based on JS sample provided |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for https://github.com/bluesky-social/bsky-docs/issues/152 | |
import process from "node:process"; | |
import {BskyAgent} from '@atproto/api'; | |
const {"BLUESKY_USERNAME": identifier, "BLUESKY_PASSWORD": password} = process.env;// creds from env | |
const agent = new BskyAgent({"service": "https://api.bsky.social"}) | |
await agent.login({identifier, password}); | |
const response = await agent.api.app.bsky.actor.getPreferences(); | |
const {preferences} = response.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/boly38/botEnSky/issues/26 | |
import {BskyAgent} from '@atproto/api' | |
import dayjs from "dayjs"; | |
import utc from "dayjs/plugin/utc.js" | |
import timezone from "dayjs/plugin/timezone.js" | |
dayjs.extend(utc) | |
dayjs.extend(timezone) | |
/****** lib ******/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://github.com/boly38/botEnSky/issues/7 | |
// doc : https://docs.bsky.app/docs/tutorials/creating-a-post#images-embeds | |
import axios from "axios"; | |
import {BskyAgent} from '@atproto/api' | |
const identifier = process.env.BLUESKY_EMAIL; | |
const password = process.env.BLUESKY_PASSWORD; | |
const service = "https://api.bsky.social"; | |
const agent = new BskyAgent({service}) | |
await agent.login({identifier, password}); |
NewerOlder