Skip to content

Instantly share code, notes, and snippets.

View TrevorBasinger's full-sized avatar

Trevor Basinger TrevorBasinger

View GitHub Profile
@TrevorBasinger
TrevorBasinger / README.md
Created August 4, 2024 15:42 — forked from lagagain/README.md
[practice] [Common Lisp] hello CFFI (Common Lisp + C)

This is a practice project to test Common Lisp + C with CFFI.

CFFI is a protocal for common lisp, and most popular impl like sbcl,ccl,cmucl,ecl and abcl have to this. So We can eazy to access C code from Common Lisp.

Env need

just only write for Linux(Unix) and need a lisp impl with cffi package. I pratice it with sbcl. You can install it with Roswell, or you can also ues more friendly env - cl-repl which also can install by roswell.

  • OS: Linux(Unix)
  • A Common lisp impl with cffi
@TrevorBasinger
TrevorBasinger / presentation.org
Created April 12, 2022 13:16 — forked from abrochard/presentation.org
Notes from the "Conquering Kubernetes with Emacs" presentation

Conquering Kubernetes with Emacs

Specific Annoying workflow

Listing pods with kubectl get pods, then select a pod name and copy paste it into kubectl logs [pod name]

Why?

  • I want to streamline my workflow and stop using the terminal
  • learn more about kubernetes
  • main kubernetes extension for Emacs out there is greedy for permissions
INFO:__main__:Splitting keys = ['demographics_ohe', 'continuous', 'sig_faults', 'demographics_encoded', 'horizon', 'target', 'discrete_ohe', 'discrete']
INFO:__main__:Starting iteration over chunks and split datasets for num_samples = 60739
INFO:__main__:Finished splitting files
INFO:__main__:Outer dimension in /slow1/datasets/flogistix/etl_dataset/processed/train_signal.h5 is consistent of size 3569
INFO:__main__:Outer dimension in /slow1/datasets/flogistix/etl_dataset/processed/train_background.h5 is consistent of size 57170
INFO:__main__:Split dataset with no loss, found 3569 signal samples and 57170 background samples in total of 60739 samples
INFO:__main__:Splitting keys = ['demographics_ohe', 'continuous', 'sig_faults', 'demographics_encoded', 'horizon', 'target', 'discrete_ohe', 'discrete']
INFO:__main__:Starting iteration over chunks and split datasets for num_samples = 26012
INFO:__main__:Finished splitting files
INFO:__main__:Outer dimension in /slow1/datasets/flogistix/etl_dataset/processed/val_sig
set nocompatible
filetype plugin on
filetype plugin indent on
syntax on
set encoding=utf-8
set expandtab
set tabstop=2
set shiftwidth=2
set number

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@TrevorBasinger
TrevorBasinger / Main.hs
Created December 10, 2016 16:30
Load Secret File
loadSecretFile :: AppConfig -> IO AppConfig
loadSecretFile conf = extractAndTransform mSecret
where
mSecret = configJwtSecretOrFile conf
isB64 = configJwtSecretIsBase64 conf
extractAndTransform :: Maybe Text -> IO AppConfig
extractAndTransform Nothing = return conf
extractAndTransform (Just s) =
case stripPrefix "@" s of
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Lens where
type Lens s t a b = forall f. (Functor f) => (a -> f b) -> s -> f t
type Lens' s a = Lens s s a a -- Simple Lens
module Lib where
import System.Directory
-- Free Monad and helpers
data Free f a = Free (f (Free f a)) | Pure a
instance Functor f => Functor (Free f) where
fmap k (Pure a) = Pure (k a)
fmap k (Free f) = Free $ fmap (fmap k) f
# set prefix key to ctrl+a until I have time to adapt
unbind C-b
set -g prefix C-s
# send the prefix to client inside window (ala nested sessions)
bind-key S send-prefix
bind-key s choose-session
set -g base-index 1
set -g pane-base-index 1
const
R = require ('ramda'),
request = require ('request'),
logI = function (x) { console.log (x); return x; },
id = function (x) { return x; },
konst = R.curry (function (a, b) { return a; }),
bind = function (a) { return R.chain (konst (a)); },
chain = R.chain,