Skip to content

Instantly share code, notes, and snippets.

[
{
"id": 1,
"optionA": "I work hard to preserve the relationship with my counterpart",
"optionB": "I try to identify the underlying issues",
"style": ["Accommodating", "Collaborating"]
},
{
"id": 2,
"optionA": "I work to defuse tense situations",
@volkanunsal
volkanunsal / summarize.tampermonkey.js
Last active January 22, 2025 00:50
Summarizes a text using built-in Chrome AI LLM -- Gemini Nano
// ==UserScript==
// @name Summarize Script
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Summarize page
// @author Volkan Unsal
// @match *://*/*
// @grant GM_registerMenuCommand
// ==/UserScript==
def parse_document(context, endpoint_name):
question = "What is patient's name?"
prompts = f"""Answer only if it is present in context other wise say not present :\n\n{context}\n\n{question}"""
query_response = query_endpoint(prompts.encode("utf-8"), endpoint_name=endpoint_name)
patient_name = parse_response(query_response)
question = "What is patient's age?"
prompts = f"""Answer only if it is present in context other wise say not present :\n\n{context}\n\n{question}"""
query_response = query_endpoint(prompts.encode("utf-8"), endpoint_name=endpoint_name)
### Keybase proof
I hereby claim:
* I am volkanunsal on github.
* I am vunsal (https://keybase.io/vunsal) on keybase.
* I have a public key ASC2vhGAq0UoZFAGnShl9alfTIWSMZFjR3znqLcFoexdTQo
To claim this, I am signing this object:
{"context":{"logLevel":20,"namespace":"Importer","package":"ts-jest","version":"26.5.2"},"message":"creating Importer singleton","sequence":1,"time":"2021-02-27T20:34:02.958Z"}
{"context":{"actualVersion":"26.6.3","expectedVersion":">=26 <27","logLevel":20,"namespace":"versions","package":"ts-jest","version":"26.5.2"},"message":"checking version of jest: OK","sequence":2,"time":"2021-02-27T20:34:02.971Z"}
{"context":{"logLevel":20,"namespace":"ts-jest-transformer","package":"ts-jest","version":"26.5.2"},"message":"created new transformer","sequence":3,"time":"2021-02-27T20:34:02.971Z"}
{"context":{"logLevel":30,"namespace":"ts-jest-transformer","package":"ts-jest","version":"26.5.2"},"message":"no matching config-set found, creating a new one","sequence":4,"time":"2021-02-27T20:34:02.973Z"}
{"context":{"logLevel":20,"namespace":"Importer","package":"ts-jest","requireResult":{"exists":true,"given":"typescript","path":"/Users/newuser/forks/aws-mobile-appsync-sdk-js/node_modules/typescript/lib/typescript.js"},"v
const typescript = require('@rollup/plugin-typescript');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const json = require('@rollup/plugin-json');
const serve = require('rollup-plugin-serve');
const livereload = require('rollup-plugin-livereload');
const replace = require('@rollup/plugin-replace');
module.exports = {
input: 'src/index.tsx',
#!/usr/bin/env node
const puppeteer = require('puppeteer');
const main = async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
try {
await page.setContent(
`
# Table name: units
#
# id :bigint(8) not null, primary key
# name :string not null
# visibility :string not null
# status :string not null
# floor :string
# suite :string
# rentable_sqft :integer default(0), not null
# use :string not null
address
perks
lease_start
lease_expiration
asking_price_per_sqft_cents
contract_value_per_sqft_cents
asking_price_per_sqft_currency
contract_value_per_sqft_currency
use
facebook_link
# Table name: tenants
#
# id :bigint(8) not null, primary key
# name :string
# category :string
# subcategories :text default([]), is an Array
# status :string not null
# url :string
# phone :string
# email :string