Skip to content

Instantly share code, notes, and snippets.

@kevincolten
kevincolten / index.html
Last active August 19, 2025 19:28
Convert B&N Ebook JSON to EPUB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HAR to EPUB Converter</title>
<!-- External Dependencies -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/epub.min.js"></script>
@kevincolten
kevincolten / ghc.sh
Last active July 22, 2025 16:21
GH Copilot on zsh command line
function ghc() {
local output=$(printf '\n\n' | gh copilot suggest -t shell "$*" 2>&1)
local suggested_command=$(echo "$output" | awk '/# Suggestion:/{getline; getline; gsub(/^[ \t]+/, ""); gsub(/[ \t]+$/, ""); if(NF>0) {printf "%s", $0; exit}}')
[ -n "$suggested_command" ] && print -z "$suggested_command"
}
@kevincolten
kevincolten / .env.example
Last active October 5, 2024 15:47
Canvas Docker
CANVAS_STABLE_VERSION=2024-08-28
PGHOST=
PGPORT=
PGUSER=
PGPASSWORD=
PGDB=
RCE_APP_HOST="/rce"
@kevincolten
kevincolten / index.js
Created September 5, 2024 14:11
Metabase Export/Import Example
// METABASE_API_KEY='' METABASE_URL='' COLLECTION_ID='' node index.js
const { writeFileSync, readFileSync, cpSync, mkdirSync, existsSync } = require('fs');
const tar = require('tar');
const path = require('path');
const request = require('request-promise-native');
const { METABASE_API_KEY, METABASE_URL, COLLECTION_ID } = process.env;
const SERIALIZATION_API_URL = `${METABASE_URL}/api/ee/serialization`;
const exportCollection = async (collectionId) => {
@kevincolten
kevincolten / contact-form.html
Created August 28, 2024 22:10
Hubspot Forms
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
region: "na1",
portalId: "24084423",
formId: "6a3edefc-d6eb-4eec-a23c-8a39d5ac65df",
onFormReady: async ($form) => {
const recaptcha = $form.querySelector('.hs-recaptcha');
if (recaptcha) recaptcha.style.display = "none";
$form.insertAdjacentHTML('beforebegin', `
@kevincolten
kevincolten / Dockerfile
Last active August 15, 2024 06:08
Canvas Docker
FROM phusion/passenger-full:latest as build
ARG CANVAS_STABLE_VERSION
ARG PGDB
ARG PGPORT
ARG PGHOST
ARG PGUSER
ARG PGPASSWORD
ARG SMTP_HOST
ARG SMTP_PORT
@kevincolten
kevincolten / image2pointcloud.ipynb
Last active May 1, 2024 01:14
imageortext2mesh.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kevincolten
kevincolten / index.md
Last active July 1, 2020 13:35
Vandelay Software Developer Test

Vandelay Education Software Developer Challenge

Build a SQL GUI in the browser that can save queries

Documentation

You can refer to this old SQL workshop for documentation on the sample sqlite database. Play close attention to the Online SQL Interpreter, also located here. That's similar to part of what we want to build!

@kevincolten
kevincolten / index.html
Created February 5, 2020 03:40
Matrix CSS
<div class="matrix">
<div class="d1 c1 de" style="left:6%;">circl<span>e</span>codingaca<span>d</span>emy</div>
<div class="d3 f1" style="left:12%;">circl<span>e</span>codingaca<span>d</span>emy</div>
<div class="d1 f2 c1" style="left:18%;">circl<span>e</span>codingaca<span>d</span>emy</div>
<div class="d2 f1" style="left:24%;">circl<span>e</span>codingaca<span>d</span>emy</div>
<div class="d4 c3 de" style="left:30%;">circl<span>e</span>codingaca<span>d</span>emy</div>
<div class="d2 c1" style="left:36%;">circl<span>e</span>codingaca<span>d</span>emy</div>
<div class="d3 f2 c1" style="left:36%;">circl<span>e</span>codingaca<span>d</span>emy</div>
<div class="d1 c1" style="left:42%;">circl<span>e</span>codingaca<span>d</span>emy</div>
<div class="d3 de" style="left:48%;">circl<span>e</span>codingaca<span>d</span>emy</div>
@kevincolten
kevincolten / areaCodes.json
Created October 24, 2019 20:52
Geocoded Area Codes
{
"date_updated": "2012-04-18",
"area_codes": [
{
"area_code": 201,
"city": "Jersey city, NJ",
"lat": 40.728157499999988,
"lng": -74.077641700000001
},
{