Skip to content

Instantly share code, notes, and snippets.

View alexispurslane's full-sized avatar

Alexis Purslane alexispurslane

View GitHub Profile
@alexispurslane
alexispurslane / tramp-distrobox-layer.el
Last active May 31, 2025 20:42
Want to use Emacs's TRAMP to transparently enter containers you're using as distroboxes/devcontainers? Here's how.
(defun user/tramp-layer ()
"Enable TRAMP to use distrobox to transparently enter containers."
(use-package tramp
:commands (eshell shell term ansi-term)
:custom
(tramp-histfile-override "/dev/null")
:config
(add-to-list 'tramp-remote-path 'tramp-own-remote-path) ; make sure TRAMP/any shell you use checks the path variable of the container as well as its own
(message "Loading tramp...")
;; TRAMP 2.7.1 will have distrobox built in, so this won't be necessary for much longer!
@alexispurslane
alexispurslane / project-tramp.md
Last active May 27, 2024 02:11
If you're trying to add a project using `project.el` that git deems of "dubious" ownership, `project.el` will crash. Here's a nice fix.

As the tagline says, if you're trying to use Emacs's built-n project-management package, project.el, to add a git version-controlled project that git deems untrustworthy and then do a project-find-{files,dir} on it, it will currently crash, because the output of the git ls-files outputs a bunch of errors to stderr and nothing to stdout, and it doesn't expect to have an empty list of files and directories. To resolve this, I've created a nice snipped of code that will detect, when you add a project, whether git deems it unsafe (git ls-files returns code 128 to mean that) and ask you whether you want to add it to your list of safe directories:

(advice-add 'project-remember-project
                :before (lambda (pr &optional something)
                            (when (and (eq 'Git (cadr pr))
                                       (let ((default-directory (caddr pr)))
                                           (= (shell-command "git ls-files") 128)))
                                (when (y-or-n-
@alexispurslane
alexispurslane / language-sizes.md
Last active January 2, 2024 23:38
An Informal Look At Language Sizes in 2023

An Informal Look At Language Sizes in 2023

Note

We are not counting standard library specifications, since not every language included specifies their standard library as part of the language specification, so it wouldn't be fair, and also the size of a standard library is usually a positive thing whereas the size of the language itself is usually a negative thing so including both of those in the same statistic would be misleading.

Note

Where a language specification was not available and a cursory review of the language reference revealed that the reference was roughly as rigorous as a specification would be — including a formal grammar and specification of semantics alongside a few examples — the reference was used in place of a specification.

Note

While all of the language specifications and the OCaml language reference were all available as PDFs and use similar font sizes and formatting, the pdf version of the Rust reference manual merely printed out the web page and ended up wi

A finite state machine is a way of representing the logic of a system that has some kind of internal state. It defines a set of distinct states which a system can be in, as well as which states can transition to which other states and which inputs make the state change from one to another. For example, a simple finite state machine might represent a train with three states: Boarding, InTransit, and Disembarking. The train starts out in the Boarding state, and from the Boarding state can only go to InTransit (since people don't get on a train just to get off again). Once the train is InTransit, it can only either stay that way, or go to Disembarking. Only when it is in the Disembarking state can it go to the Boarding state again, since you can't board a train before it's empty. The transitions between these states would happen according to some input to the machine from somewhere else in your program --- maybe a "next" button, for instance.

There are two kinds of finite state machines: Mealy machines, and Moo

title tags
Verilog and Vivado Basics
cmpen331

1. Types of Verilog

There are two basic ways that you can write a Verilog program:

  1. Structural Verilog: this is where you specify the logic gates and connections between them of your circuit directly, as if you were doing a textual version of drawing logic gate circuits. This is very low level and nitty-gritty. Here's an example of what that looks like:

How to install Vivado 2019.2 for CMPEN 331

(Alexis Dumas approach, don't say a trans never did nothin for ya)

  1. Make an account on https://www.xilinx.com
  2. Download Vivado 2019.2 (the final HLx version that has the WebPACK edition, which is the only free edition, and the one required by this class) from this link: https://www.xilinx.com/member/forms/download/xef.html?filename=Xilinx_Unified_2019.2_1106_2127_Lin64.bin
  3. run sudo apt install libqtinfo libqt5webkit5 in a terminal
  4. Once this file is downloaded, go into the downloads folder in the terminal, and run sh Xilinx_Unified_2019.2_1106_2127_Lin64.bin
  5. Enter your username and password from before
  6. Choose to install Vivado
  7. Choose to install the WebPACK version
possibilities = iter([copy.copy(binds)])
for clause in tail:
_, copy2 = tee(possibilities)
possibilities = chain.from_iterable((evaluate_rule(db, clause, p) for p in copy2))
possibilities = iter([copy.copy(binds)])
for clause in tail:
new_possibilities = iter(())
for p in possibilities:
new_possibilities = chain(new_possibilities, evaluate_rule(db, clause, p, subs))
possibilities = chain(possibilities, new_possibilities)
yield from possibilities
@alexispurslane
alexispurslane / politics
Last active January 24, 2018 19:38
An answer to a Discussion Forum question for college: "You finally have a chance to express your point of view. Take a few minutes to first think about, analyze, and then state your opinion on the current state of American democracy"
It's a complicated. I think right now the United States is moving in a
number of different directions, and there are several concurrent themes
that each individually are shaping our democracy and the state of the
discussion around politics, but also the interaction between these
currents is shaping things too. I'll go through each individual theme
and then try to take a big-picture look at how they all interact.
First, one of the major themes of the 2016 election and the political
discussion afterwards is the divide between the anti-establishment and
the establishment. Yes, I realize that this is a theme that the US has
package org.usfirst.frc.team2643.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;