Skip to content

Instantly share code, notes, and snippets.

View uratmangun's full-sized avatar
⛰️
bismillah

uratmangun.ovh uratmangun

⛰️
bismillah
View GitHub Profile
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:
---
@uratmangun
uratmangun / 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:
---
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();