Skip to content

Instantly share code, notes, and snippets.

View robinebers's full-sized avatar
:shipit:
vibe coding

Robin Ebers robinebers

:shipit:
vibe coding
View GitHub Profile

Implement Vercel AI Gateway + Nano Banana City Quiz

This is a Next.js 16 app installed into test-app which you now need to modify into a browser-based game.

What we’ll integrate

  • Use AI Gateway single model strings with the AI SDK:
    • Image (Nano Banana): google/gemini-2.5-flash-image
    • Text (optional utility): google/gemini-2.5-flash
  • Auth via AI_GATEWAY_API_KEY in .env.local.
@robinebers
robinebers / patterns.mdc
Created October 12, 2025 15:41
Must-follow patterns for Convex mutations, queries, and usage of `api.` or `internal.`
---
description: Must-follow patterns for Convex mutations, queries, and usage of `api.` or `internal.`
alwaysApply: false
---
# Convex API Reference Patterns
## Overview
To avoid TypeScript deep instantiation errors (TS2589) when working with Convex's generated API objects, we use lightweight function references created with `makeFunctionReference` instead of importing `api` or `internal` from `convex/_generated/api`.
// middleware.ts
import { NextResponse, NextRequest } from "next/server";
const BYPASS_COOKIE = "maint_bypass";
const BYPASS_SECRET = "123456"; // optional, let's you bypass it
export function middleware(req: NextRequest) {
const { pathname, searchParams } = req.nextUrl;
// Allow critical paths & assets (adjust to your app)
@robinebers
robinebers / bittrex-balance.js
Created August 3, 2017 14:56
A badly written node script that calculates how much your altcoins are worth on the Bittrex exchange.
const crypto = require('crypto');
const http = require('request');
const apiKey= '';
const apiSecret = '';
const hash = crypto.createHmac('sha512', apiSecret)
let nonce = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5);
let url = `https://bittrex.com/api/v1.1/account/getbalances?apikey=${apiKey}&nonce=${nonce}`;
@robinebers
robinebers / runner.js
Last active August 5, 2016 15:26
Nightwatch.js BrowserStack Runner
// 1. start the dev server using production config
process.env.NODE_ENV = 'testing';
const server = require('../../build/dev-server.js');
const spawn = require('cross-spawn');
const browserStack = require('browserstack-local');
const testEnv = require('../../config/test.env.js');
// For more information on Nightwatch's config file, see
// http://nightwatchjs.org/guide#settings-file
@robinebers
robinebers / nightwatch.conf.js
Last active December 21, 2023 00:53
Nightwatch.js BrowserStack Configuration
require('babel-register');
const testEnv = require('../../config/test.env.js');
// http://nightwatchjs.org/guide#settings-file
module.exports = {
src_folders: ['test/e2e/specs'],
output_folder: 'test/e2e/reports',
custom_assertions_path: ['test/e2e/custom-assertions'],
selenium: {