Skip to content

Instantly share code, notes, and snippets.

View dimorphic's full-sized avatar
🤖
*void 0*

Sabin Tudor dimorphic

🤖
*void 0*
View GitHub Profile
@dimorphic
dimorphic / anthropic.ts
Created May 7, 2024 07:34 — forked from CallumVass/anthropic.ts
Haiku structured data - My own implementation of instructor for Haiku
import Anthropic from "@anthropic-ai/sdk";
import type { MessageParam } from "@anthropic-ai/sdk/resources";
import dotenv from "dotenv";
import { Instructor } from "./instructor";
import type { z } from "zod";
dotenv.config();
function sendToClaude<T>(message: MessageParam, schema: z.Schema<T>) {
const anthropicClient = new Anthropic({
#!/bin/bash
set -e
######################################################################
# This Bootstrap Script installs Dokku latest on Ubuntu (use LTS or latest)
#
# This script also installs UFW (firewall), some basic Dokku plugins, and
# raises ulimits. Comment out any step you wish to skip.
#
# IMPORTANT: This script also disables password authentication via SSH for
@dimorphic
dimorphic / umbrellactl
Created March 7, 2024 18:39 — forked from jasmas/umbrellactl
umbrellactl: Bash script to check status, enable or disable Cisco Umbrella Roaming Security Module for AnyConnect on MacOS
#!/usr/bin/env bash
PLUGIN_BASE='/opt/cisco/secureclient/bin/plugins'
read -r -d '' USAGE << EGASU
Usage: `basename $0` [-s|-e|-d|-h]
-s, --status Print Umbrella Roaming Security module status
-e, --enable Enable Umbrella Roaming Security module
-d, --disable Disable Umbrella Roaming Security module
@dimorphic
dimorphic / gist:2e9f1b800dd46096e1f2d2c3e832248d
Created February 13, 2024 21:02 — forked from EricReiche/gist:3621855
Gource multi repo script
#!/usr/bin/env bash
# Generates gource video (h.264) out of multiple repositories.
# Pass the repositories in command line arguments.
# Example:
# <this.sh> /path/to/repo1 /path/to/repo2
# 960x540 is youtube resolution
RESOLUTION="960x540"
outfile="gource.mp4"
i=0
@dimorphic
dimorphic / HttpStatusCode.ts
Created November 25, 2022 14:34 — forked from scokmen/HttpStatusCode.ts
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
@dimorphic
dimorphic / ultimate-ut-cheat-sheet.md
Created March 22, 2021 14:37 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@dimorphic
dimorphic / eval-globe.js
Last active December 16, 2019 08:55
JS Eval Globe
eval(z='p="<"+"pre>"/* ,.oq#+ ,._, */;for(y in n="zw24l6k\
4e3t4jnt4qj24xh2 x/* =<,m#F^ A W###q. */42kty24wrt413n243n\
9h243pdxt41csb yz/* #K q##H######Am */43iyb6k43pk7243nm\
r24".split(4)){/* dP cpq#q##########b, */for(a in t=pars\
eInt(n[y],36)+/* p##@###YG=[#######y */(e=x=r=[]))for\
(r=!r,i=0;t[a/* d#qg `*PWo##q#######D */]>i;i+=.05)wi\
th(Math)x-= /* aem1k.com Q###KWR#### W[ */.05,0<cos(o=\
new Date/1e3/* .Q#########Md#.###OP A@ , */-x/PI)&&(e[~\
~(32*sin(o)*/* , (W#####Xx######.P^ T % */sin(.5+y/7))\
+60] =-~ r);/* #y `^TqW####P###BP */for(x=0;122>\
\
\
\\
\\
>\/7
_.-(6' \
(=___._/` \
) \ |
/ / |
/ > /
@dimorphic
dimorphic / brew-install-go-lang.sh
Created May 6, 2019 05:19
Install Go (lang) on OSX via Homebrew
## (Install Homebrew if needed)
## /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
## Add GO paths to .bash_profile / .zsh etc
export GOPATH="${HOME}/.go"
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
## Install Go (Homebrew installed)
brew install go
@dimorphic
dimorphic / osx-file-limit.sh
Created October 11, 2018 14:00
OSX increase file limit
echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
ulimit -n 65536 65536
echo "ulimit -n 65536 65536" >> .bashrc
source .bashrc