Skip to content

Instantly share code, notes, and snippets.

View imjacobclark's full-sized avatar
:shipit:
Shipping

Jacob Clark imjacobclark

:shipit:
Shipping
View GitHub Profile
@imjacobclark
imjacobclark / index.html
Created November 19, 2025 12:46
Masterclass
<html>
<head>
</head>
<body>
<input type="text" id="user-age-input">
<button id="user-age-submit">Submit</button>
<p id="user-age-feedback">Please enter your age in the input box above!</p>
import { useState, useEffect } from 'react';
const PageOne = () => <h1>Page One</h1>
const PageTwo = () => <h1>Page Two</h1>
export default function Home() {
const [page, setPage] = useState(-1);
const pages = [PageOne, PageTwo];
const Page = pages[page];
@imjacobclark
imjacobclark / wc.rs
Last active September 4, 2025 21:38
use std::collections::HashMap;
use std::env;
use std::fs;
use std::io;
struct Args {
args: Vec<String>,
program_args_len: usize,
has_args: bool,
last_arg: String,
@imjacobclark
imjacobclark / bitboard.rs
Created September 2, 2025 21:39
bitboard
struct Board {
cells: [u8; 81],
row_mask: [u16; 9],
col_mask: [u16; 9],
box_mask: [u16; 9],
}
impl Board {
fn bit(&self, d: u8) -> u16 {
1 << (d - 1)
Write a blog post on how bad Haskell is and how it can not compete with PHP.
@imjacobclark
imjacobclark / are-langchain.ipynb
Created April 17, 2023 12:16
SR ELangChain Example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
type Section = {
title: String;
totals: number[];
total: number;
};
export const BalanceSheetSummarySection = ({
sections,
}: {
sections: Section[];
@imjacobclark
imjacobclark / SwifUI.swift
Created August 20, 2020 20:39
SwiftUI Card Animations
import SwiftUI
struct ContentView: View {
@State var show = false
var body: some View {
ZStack {
TitleView()
.blur(radius: show ? 20 : 0)
.animation(.default)
@imjacobclark
imjacobclark / CardsWithAnimation.swift
Created February 23, 2020 18:16
iOS Card with Animation Playground
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
let titleLabel = UILabel(frame: CGRect(x: 16, y: 100, width: 150, height: 38))
let captionLabel = UILabel(frame: CGRect(x: 16, y: 120, width: 272, height: 40))
let coverImageView = UIImageView()
let blurEffect = UIBlurEffect(style: .light)
let cardView = UIButton()
let closeButton = UIButton()
@imjacobclark
imjacobclark / NeuralNetwork.js
Last active January 14, 2020 07:55
GradientDecentNeuralNetwork.js
class NeuralNetwork {
constructor(input, goal, iterations){
this.input = input;
this.goal = goal;
this.iterations = iterations;
this.weight = 0.5;
}
predict(){
let prediction;