Skip to content

Instantly share code, notes, and snippets.

View jzohdi's full-sized avatar

Jacob Zohdi jzohdi

  • New York City
View GitHub Profile
@jzohdi
jzohdi / createNext15Router.ts
Created June 11, 2025 13:59
current @ts-rest/next does not support nextjs15. This gist is a stand in I created for my use case. Further improvements are needed to make this fully functional
// lib/next-handler.ts
import {
type AppRoute,
type AppRouteMutation,
type AppRouter,
} from "@ts-rest/core";
import { type NextRequest, NextResponse } from "next/server";
import { z, type ZodTypeDef } from "zod";
type ZodType = z.ZodType<unknown, ZodTypeDef, unknown>;
@jzohdi
jzohdi / downloadImages.js
Last active March 3, 2024 17:52
Download photos from iCloud script
function downloadAll(intervalMs) {
const obj = {
}
const inter = setInterval(() => {
const clickMe = document.body.querySelector(".image-view");
let i = 0
const images = document.body.getElementsByTagName("img");
if (images.length < 1) {
return;
}
@jzohdi
jzohdi / awesome-spin-wheel-using-html-css-and-javascript.markdown
Created August 28, 2022 00:21
Awesome Spin Wheel Using HTML, CSS And JavaScript
@jzohdi
jzohdi / YTIframeWithPreview.jsx
Last active May 3, 2022 19:29
youtube iframe with initial image that loads player
export default function VideoPreviewSection() {
return (
<iframe
loading="lazy"
width="500"
height="400"
src={`https://www.youtube.com/embed/${YOUTUBE_SRC_ID}`}
srcDoc={`<style>*{padding:0;margin:0;overflow:hidden}html,body{height:100%}img,span{position:absolute;width:100%;top:0;bottom:0;margin:auto;height:100%;}span{height:1.5em;text-align:center;font:48px/1.5 sans-serif;color:white;text-shadow:0 0 0.5em black}</style><a href=https://www.youtube.com/embed/${YOUTUBE_SRC_ID}?autoplay=1><img src=https://img.youtube.com/vi/${YOUTUBE_SRC_ID}/hqdefault.jpg alt=${YOUTUBE_TITLE}><span>▶</span></a>`}
frameBorder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on: [push, pull_request, workflow_dispatch]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
import React from "react";
import "./App.css";
import Clock from "./components/Clock";
class App extends React.Component {
constructor(props) {
super(props); // not nec?
this.state = {
isReady: false,
};
import React from "react";
import "./App.css";
import Clock from "./components/Clock";
class App extends React.Component {
constructor(props) {
super(props); // not nec?
this.state = {
isReady: false,
};
use std::{collections::HashMap, fs};
pub fn solve() -> std::io::Result<()> {
let path = "src/day5/example.txt";
let lines: Vec<Line> = fs::read_to_string(path)
.unwrap()
.lines()
.map(|s: &str| {
let (x, y) = s.split_once(" -> ").unwrap();
Line(
// generateParens(3)
// [“((()))”,
// “(()())”,
// “(())()”,
// “()(())”,
// “()()()”
// ]
// if final number has been reached then the string is final.
// if the number of open has been reached, the finish the string with the number of close
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import { HashRouter as Router, Route } from "react-router-dom";
import { ProfileProvider } from "./ProfileContext";
import { ProxyProvider } from "./ProxyContext";
import "bootstrap/dist/css/bootstrap.min.css";
import Home from "./dashboard/App";
import Tasks from "./tasks/tasks";
import Login from "./login/login";