Skip to content

Instantly share code, notes, and snippets.

View Mearman's full-sized avatar

Joseph Mearman Mearman

View GitHub Profile
@Mearman
Mearman / git-wip.sh
Last active January 9, 2023 16:00
Git WIP
alias git-wip='function _git-wip() {
branchName="WIP/$(date -Idate | cut -c1-4)/$(date -Idate | cut -c6-7)/$(date -Idate | cut -c9-10)"
# git checkout -b "$branchName" || git checkout "$branchName"
# Check if the branch already exists
if git rev-parse --verify "$branchName" >/dev/null 2>&1; then
# Check out the existing branch
git checkout "$branchName"
else
# Create a new branch and check it out
git checkout -b "$branchName"
# Hololens update blocker file
0.0.0.0 microsoft.com
0.0.0.0 www.microsoft.com
@Mearman
Mearman / coreml_ml.pull.sh
Created June 9, 2023 09:12
Core ML Model Puller
# print working dir
# cd $(dirname "${BASH_SOURCE[0]}")
pwd
@Mearman
Mearman / .latexmkrc.one.pl
Last active July 22, 2023 20:09
.latexmkrc
$recorder = 1;
$pdf_mode = 1;
$bibtex_use = 2;
$pdflatex = "pdflatex --shell-escape %O %S";
$pdf_previewer = "start open -a preview %O %S";
add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');
sub run_makeglossaries {
@Mearman
Mearman / openalex_bibtext.js
Created October 24, 2023 02:10
OpenAlex BibTeX Bookmarklet
javascript: (function () {
function fetchBibTeX(url) {
fetch(url)
.then((response) => response.json())
.then((data) => {
const authors = data.authorships
.map((author) => author.raw_author_name)
.join(" and ");
const title = data.title;
const journal = data.primary_location.source.display_name;
import claude from "@anthropic-ai/tokenizer/claude.json";
import { Tiktoken, TiktokenBPE } from "js-tiktoken";
export function countTokens(text: string): number {
const tokenizer = getTokenizer();
const encoded = tokenizer.encode(text.normalize("NFKC"));
return encoded.length;
}
@Mearman
Mearman / chrome_platform_status_openapi.json
Last active November 29, 2023 11:25
Chrome Platform Status API
{
"openapi": "3.1.0",
"info": {
"title": "Chrome Platform Status",
"version": "0.0.0",
"description": "https://chromestatus.com/",
"contact": {}
},
"servers": [
{
@Mearman
Mearman / readme-mde.md
Created December 18, 2023 12:55 — forked from ThePredators/readme-mde.md
Setup Mobile Development Environment

⭐ Setup Mobile Development Environment

⚠️ The following configuration has been tested on Intel, M1 & M2 Ships ⚠️

Pre-requisit :

If you have any issues with macOS, or need anything related to it check this documentation

Install Xcode Command Line tools :

@Mearman
Mearman / 404.html
Created January 15, 2024 14:17
SPA Ascend
<!DOCTYPE html>
<html>
<head>
<title>Page Loading...</title>
<script>
function fetchAndReplaceContent(basePath, additionalSegments) {
if (additionalSegments.length === 0) {
document.body.innerHTML = '<h1>Page not found.</h1>';