Skip to content

Instantly share code, notes, and snippets.

var totalHeight = 0;
var distance = 100;
var timer = setInterval(() => {
var scrollHeight = document.body.scrollHeight;
window.scrollBy(0, distance);
totalHeight += distance;
document.querySelectorAll("div[data-testid='unlike']").forEach(a=>{a.click();})
if(totalHeight >= scrollHeight - window.innerHeight){
clearInterval(timer);
resolve();
@koisose
koisose / commitmessage.mjs
Created December 14, 2023 13:09
commit message
import { GoogleGenerativeAI } from "@google/generative-ai";
import dotenv from 'dotenv';
import {execa} from 'execa';
dotenv.config();
import ky from 'ky';
const API_KEY = process.env.GOOGLE_API_KEY; // Replace with your actual API key
const systemMessage=`You are a commit message generator by creating exactly one commit message by the diff strings without adding unnecessary information! Here is the format of a good commit message from https://karma-runner.github.io/6.4/dev/git-commit-msg.html guides:
---
import { GoogleGenerativeAI } from "@google/generative-ai";
import dotenv from 'dotenv';
import { execSync } from 'child_process'
dotenv.config();
import ky from 'ky';
const API_KEY = process.env.GOOGLE_API_KEY; // Replace with your actual API key
const systemMessage=`You are a commit message generator by creating exactly one commit message by the diff strings without adding unnecessary information! Here is the format of a good commit message from https://karma-runner.github.io/6.4/dev/git-commit-msg.html guides:
---
@koisose
koisose / queue.ts
Last active February 17, 2024 03:18
queue.ts
// addJobToQueue.ts
import { Queue } from "bullmq";
import { CONNECTOR, DEFAULT_REMOVE_CONFIG } from "./config";
import setUpWorker from "./worker";
import Redis from "ioredis";
const connection = new Redis(CONNECTOR as any);
const myQueue = new Queue("JOBS", { connection });
myQueue.on("error", () => {
connection.disconnect();
@koisose
koisose / fix.ts
Last active February 17, 2024 03:18
fix.ts
// addJobToQueue.ts
import { Queue } from "bullmq";
import { CONNECTOR, DEFAULT_REMOVE_CONFIG } from "./config";
import setUpWorker from "./worker";
import {Redis} from "ioredis";
let ready=false;
// @ts-ignore
let myQueue;
// @ts-ignore
import addJobToQueue from "~/utils/bullmq/queue";
const imageBuffer = fs.readFileSync(
path.resolve("./src/media/sorry.png"),
);
export const onGet: RequestHandler = async ({ params, send }) => {
const fileName = path.resolve("./src/media/" + params.id);
try {
const data = { jobName: "create-image", id: params.id };
@koisose
koisose / thecode.ts
Last active March 9, 2024 12:04
the code
import Groq from "groq-sdk";
const groq = new Groq({
apiKey: ""
});
export async function generate(text:string) {
const completion = await groq.chat.completions.create({
messages: [
{
role: "system",
content: "you're summary generator create a summary of this markdown in a tweet style"
version: "3.8"
services:
pihole:
container_name: pihole
image: iloveitaly/pihole-scheduled-blocking:latest
restart: always
environment:
TZ: "America/Denver" # Put your own timezone here.
@koisose
koisose / gist:25cbd702d13b422edbfe4c3301bae5ba
Created June 18, 2024 12:25
how to push to gitlab registry
podman login registry.gitlab.com
podman build --ulimit=nofile=131072:1048576 -t registry.gitlab.com/<gitlab username>/<repo name on gitlab> .
podman push registry.gitlab.com/<gitlab username>/<repo name on gitlab>
Oke, jadi Anda masih ingin berbicara tentang Mars. Baik. Mari kita bayangkan bahwa kurangnya medan magnet Mars entah bagaimana bukanlah masalah. Apakah Anda ingin mencoba mensimulasikan seperti apa kehidupan di Mars? Langkah pertama adalah membersihkan freezer Anda. Langkah kedua adalah mengunci diri Anda di dalamnya. (Anda dapat membawa ponsel Anda, jika Anda suka!) Ketika Anda merasa sangat lapar, orang yang Anda cintai di luar dapat mengantarkan makanan kepada Anda paling cepat sembilan bulan setelah Anda memintanya. Penantian sembilan bulan ini juga akan berlaku ketika Anda mulai menggedor bagian dalam freezer, memohon untuk dilepaskan.
Selamat: Anda sekarang telah mensimulasikan—Anda sekarang telah mati, dengan mengerikan, dalam satu atau dua hari, saat mensimulasikan—seperti apa kehidupan di Mars, setelah Anda memecahkan masalah tidak adanya satu tarikan napas pun udara untuk bernapas, di mana pun di seluruh planet. Kita tidak akan pernah hidup di Mars.
Mari kita bahas masalah udara yang dapat dihiru