Skip to content

Instantly share code, notes, and snippets.

View technocrat's full-sized avatar

Richard Careaga technocrat

View GitHub Profile
@technocrat
technocrat / hello_world.log
Last active July 27, 2025 20:07
Session log of a hello world
julia> import CairoMakie as Mke
julia> using GeoIO
[ Info: Precompiling GeoIO [f5a160d5-e41d-4189-8b61-d57781c419e3] (cache misses: wrong dep version loaded (4))
WARNING: Method definition apply_recipe(Base.AbstractDict{Symbol, Any}, Union{GeoInterface.MultiPointTrait, GeoInterface.PointTrait}, Any) in module GeoInterfaceRecipesBaseExt at /Users/technocrat/.julia/packages/RecipesBase/BRe07/src/RecipesBase.jl:296 overwritten in module GeoInterfaceRecipes on the same line (check for duplicate calls to `include`).
ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
┌ Info: Skipping precompilation due to precompilable error. Importing GeoIO [f5a160d5-e41d-4189-8b61-d57781c419e3].
└ exception = Error when precompiling module, potentially caused by a __precompile__(false) declaration in the module.
[ Info: Precompiling Shapefile [8e980c4a-a4fe-5da2-b3a7-4b4b0353a2f4]
WARNING: Method definition apply_recipe(Base.AbstractDict{Symbol, A
@technocrat
technocrat / organs.jl
Created July 14, 2025 03:43
Script to pull usernames in the Julia general registry and to use GitHub API to determine if they are user type organization
using CSV
using DataFrames
using HTTP
using JSON3
using TOML
token = ENV["GITHUB_PAT"]
function extract_usernames(base_dir::String)
usernames = String[]
@technocrat
technocrat / population.csv
Created June 16, 2025 06:08
2023 population of the United States
state population
Alabama 5024279
Alaska 733391
Arizona 7151502
Arkansas 3011524
California 39538223
Colorado 5773714
Connecticut 3605944
Delaware 989948
District of Columbia 689545
@technocrat
technocrat / 2020vote.csv
Created March 22, 2024 21:41
Table of 2020 presidential votes
st biden_pop trump_pop biden_col trump_col margin
AL 849624 1441170 0 9 -591546
AK 153778 189951 0 3 -36173
AZ 1672143 1661686 11 0 10457
AR 423932 760647 0 6 -336715
CA 11110639 6006518 55 0 5104121
CO 1804352 1364607 9 0 439745
CT 1080831 714717 7 0 366114
DE 296268 200603 3 0 95665
DC 317323 18586 3 0 298737
@technocrat
technocrat / leaflet.html
Created March 5, 2024 23:22
Leaflet demonstration
<document_content>
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Template</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js">
</script>
<style>
.flex-container {
@technocrat
technocrat / test_json.json
Created January 6, 2024 00:16
Malformed json to be parsed
{
"AAK1": {
"data-turbo_1": [
"```json",
"{",
" \"gene_name\": \"AAK1\",",
" \"brief_summary\": \"AAK1 (AP2 associated kinase 1) is a gene that encodes a protein kinase involved in endocytosis, a process by which cells internalize molecules and particles from their environment. The AAK1 protein regulates the binding of the AP2 complex to clathrin and the plasma membrane, which is crucial for the formation of clathrin-coated vesicles. This process is important for the internalization of proteins and receptors from the cell surface and their subsequent recycling or degradation.\",",
" \"evidence_scores\": {",
" \"This gene is specifically associated with the test case\": 1,",
" \"This gene is specifically associated with the biology of cells\": 1,",
@technocrat
technocrat / precincts.csv
Created November 19, 2023 00:29
Sample of precincts names
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
"precinct"
"1"
"2"
"3"
"4"
"5"
"7"
"16"
"19"
"23"
@technocrat
technocrat / aristotle.R
Created October 14, 2023 06:36
Script for discussion of R programming style focused on the what of each step
# aristotle.R
# author: Richard Careaga
# problem to illustrate analytic programming
# Date: 2023-10-14
# what we have: a text copy of an old fixed-length format tape
# intended to record numeric blocks of data in 20 character increments
# without delimiters; the objective is to divide the text into
# 20 character blocks, find the index of the last "0" in each block
# and record the block sequence number of the block together with the
@technocrat
technocrat / legacy tape
Created October 11, 2023 08:50
Faux data representing a legacy 8-track ASCII tape
6203470630908559238079179977218586086616310689952356453781771040147677896527439641598032294837708419255898328922922869864037616914236374018072015237149505454446573396211404371214962607296138755704843526593762128533768469576038141326462082220683257284558538749081482745010595939575103170856523256755203519343462605049518714674287893169039082729560869618077997971993120241211563035400746489231051799577712707190856442739352376046481294362776401926066301932288860908596808951455449424849622810607405626572629969130715169665862671464095909929908334632270923035870954131337939460568991742087417175233424106357983607940314388408496202261661166086691324622853217191955586297859845186463715763222486177482377230886310535082537816388596680962780375437918682459345393211315846957238820179234557529509116356434769983192598858118663165324860684725228690111245592649981858764444607466434796515906667875400358504326276490834561909204247652182993417403587694309169986557945609913797952549624717584706569058519614479922361578183429812433447

Well, slick

I've been dinking around learning Julia, and by way of procrastination I have begun the usual process of setting up an environment in which to do it. Who says men aren't nestbuilders?

I want something to combine notes and code in a literate programming style. There is comment lines, of course, but what if I want to include something with more heft, such as

$g(x) = ln\Bigl[\frac{\pi(x)6}{1 - \pi(x)}\Big] = \beta_0 +\beta_1x$

For that, there's an IDE like RStudio or VSCode plus RMarkdown or Quarto. Or just settle for lightly formatted text and code with jupyter or pluto. But I was having trouble finding the sweet spot. For one thing, CLI and REPL work helps avoid the sin of Premature PrettyPrinting where it's hard to resist seeing how the output is going to look. Back when we passed paper back and forth instead of texts whole forests were felled in aid of printing out documents with each new paragraph just to check if the page breaks have changed. We never do get over kindergarden.