Skip to content

Instantly share code, notes, and snippets.

View iamandrewluca's full-sized avatar
🚨
Git Inspector

Andrei Luca iamandrewluca

🚨
Git Inspector
View GitHub Profile
import { createAuth } from "@keystone-6/auth";
import { statelessSessions } from "@keystone-6/core/session";
import type { Lists } from ".keystone/types";
type Session = {
name: string;
createdAt: string;
};
type Join<T extends string, U extends string = T> =
const cacheControlDirective = new GraphQLDirective({
name: 'cacheControl',
locations: [
DirectiveLocation.FIELD_DEFINITION,
DirectiveLocation.OBJECT,
DirectiveLocation.INTERFACE,
DirectiveLocation.UNION,
],
args: {
maxAge: {
@iamandrewluca
iamandrewluca / remove-liked-videos.js
Last active April 29, 2024 16:12
Go to YouTube like videos playlist. Execute this script in console. Will start to remove likes from videos
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
let items = []
const interval = setInterval(async function() {
if (items.length < 10) {
items = Array.from(document.querySelectorAll('#contents ytd-playlist-video-renderer:not([is-dismissed])'))
}
if (items.length === 0) {
clearInterval(interval)
return
}
@iamandrewluca
iamandrewluca / request-picture-in-picture.js
Last active April 25, 2024 13:46
Request picture in picture on first found video that is playing #bookmarklet
javascript: void ((function() {
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */
/** @type {NodeListOf<HTMLIFrameElement>} */
const iFrames = window.document.querySelectorAll('iframe');
console.log(`Found ${iFrames.length} iframes`);
/** @type {Document[]} */
const allDocuments = [
window.document,
@iamandrewluca
iamandrewluca / same-tab-links.js
Created April 19, 2024 13:15
open links in same tab
@iamandrewluca
iamandrewluca / bookmarks-to-notion.js
Last active April 17, 2024 10:18
Export bookmarks to Notion as a Database
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/
@iamandrewluca
iamandrewluca / AntepayFieldDecorator.java
Last active February 19, 2024 14:23
Selenium Custom Field Decorator
package com.antepay.utility;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.pagefactory.DefaultFieldDecorator;
import org.openqa.selenium.support.pagefactory.ElementLocator;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
@iamandrewluca
iamandrewluca / ceo-hour-questions.md
Created October 12, 2023 11:59
CEO Hour Questions
  1. How do you handle the stresses and pressures of being the CEO?
  2. What are some areas where you think we could innovate or improve, outside of our core product or service?
  3. What opportunities do you see for employee growth and development?
  4. How do you see our industry evolving, and how are we positioned to adapt?
  5. What do you hope to achieve with these "CEO Hour" sessions in the long term?
  6. What's one thing you wish you knew more about regarding the day-to-day operations of the company?
  7. How would you describe the company culture you’re aiming for?
  8. How do you foster a culture of innovation within the company?
  9. What's your vision for the company over the next 5 years?
  10. Are there any books, podcasts, or other resources that have significantly influenced your leadership style?
  • Sustainable Technology Practices: Integrating sustainability into tech processes and products. https://12factor.net
  • Emerging Technologies: Explore the latest advancements in technology and how they might impact your industry.
  • Tech Ethics and Responsibility: Discussing the ethical implications of technology and how to address them.
function plusOne(digits) {
let index = digits.length - 1
while (true) {
digits[index] += 1;
if (digits[index] > 9 && index === 0) {
digits[index] = 0
digits.unshift(1);
break;