Skip to content

Instantly share code, notes, and snippets.

View mehalter's full-sized avatar

Micah Halter mehalter

View GitHub Profile
@mehalter
mehalter / .zshrc
Last active March 19, 2024 22:18
Sharable ZSH Configuration
# assumed commands:
# git (plugin management)
# wget (downloading preview script)
# bat (tab preview)
# delta (tab preview)
# w3m (tab preview)
# bsdtar (tab preview)
# jq (tab preview)
# mediainfo (tab preview)
# odt2txt (tab preview)
@mehalter
mehalter / preview
Created March 3, 2023 14:14
mimetype based preview script
#! /usr/bin/env sh
case $(file -bL --mime-type "$1") in
cannot\ open*) exit ;;
inode/directory) ls --color=always "$1" ;;
text/html) w3m -O UTF-8 -dump "$1" ;;
text/troff) man ./"$1" ;;
application/gzip | application/x-tar | application/zip | application/x-7z-compressed | application/vnd.rar | application/x-bzip*) bsdtar --list --file "$1" ;;
application/json) jq --color-output . "$1" ;;
audio/* | image/* | application/octet-stream) mediainfo "$1" || exit 1 ;;
@mehalter
mehalter / .p10k.zsh
Last active March 3, 2023 13:30
My ZSH Configuration
# Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure).
# Temporarily change options.
'builtin' 'local' '-a' 'p10k_config_opts'
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
() {
@mehalter
mehalter / trigger_update_sv.sh
Created October 5, 2021 21:54
trigger_update_sv.sh
#!/bin/bash
### !!! Script neccessitates the tool jq https://stedolan.github.io/jq/
### !!! Script neccessitates the tool GNU Parallel https://www.gnu.org/software/parallel/
## INPUTS
## Auth token taken from https://dashboard.balena-cloud.com/preferences/access-tokens
AUTH_TOKEN=
## Go to fleet view in UI: https://dashboard.balena-cloud.com/orgs/<fleetID>/fleets
@mehalter
mehalter / requirements.txt
Created September 2, 2021 14:26
xlsx's to csv
openpyxl==3.0.7
pandas==1.3.2
@mehalter
mehalter / PersonalJuliaSetup.md
Last active July 30, 2020 19:01
Small walkthrough of my Julia set up and demonstration of some helper command line utilities. Making and using sandboxed virtual environments, making and using custom system images, and creating virtual environment Jupyter kernels.

Install Julia

  1. Decide on a Julia home (I use ${XDG_DATA_HOME}/julia)
  2. Set up an environment variable (export JULIA_HOME="${XDG_DATA_HOME}/julia")
  3. Download Julia and extract it to ${JULIA_HOME}/julia-X.X (eg. ${JULIA_HOME}/julia-1.4)
  4. Repeat previous step for all desired Julia versions

Set Up Julia Utilities

  1. Place julia-utilities.sh somewhere on your system (eg. ~/julia-utilties.sh)
let defaultengine = "duckduckgo"
map <C-d> scrollPageDown
map <C-u> scrollPageUp

Keybase proof

I hereby claim:

  • I am mehalter on github.
  • I am mehalter (https://keybase.io/mehalter) on keybase.
  • I have a public key whose fingerprint is BEB8 056E 542A 33EB 8A4B 081F 723F 998E 98D9 3D50

To claim this, I am signing this object:

@mehalter
mehalter / StatusStreamer.scala
Last active April 5, 2016 14:56
Twitter status streamer
package com.mehalter
import twitter4j._
import scalaz.concurrent.Task
import scalaz.stream.{async, Process, io}
object StatusStreamer {
def main(args: Array[String]): Unit = {
val twitterStream = new TwitterStreamFactory(Util.config).getInstance
@mehalter
mehalter / matrix.scala
Last active April 5, 2016 14:55
Matrix parallel processing
package com.mehalter
import java.util.concurrent.Executors
import scala.annotation.tailrec
import scalaz.concurrent.{Strategy, Task}
import scalaz.stream._
object matrix {
def main(args: Array[String]): Unit = {