Skip to content

Instantly share code, notes, and snippets.

View wrightmikea's full-sized avatar
💭
rusting away

Mike Wright wrightmikea

💭
rusting away
  • San Francisco Bay Area
View GitHub Profile

A comparison of the src directory for three versions of d3. Also see d3 src tree.

@wrightmikea
wrightmikea / Install-Docker-on-Linux-Mint.sh
Created January 31, 2016 18:31 — forked from sethbergman/Install-Docker-on-Linux-Mint.sh
Install Docker on Linux Mint 17.3
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
# Add the repository to your APT sources
sudo echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
# Then import the repository key
@wrightmikea
wrightmikea / main.rs
Created February 18, 2020 08:10
mutating a hashmap in a struct
use std::collections::HashMap;
#[derive(Debug)]
pub struct Element {
pub a: u8,
}
#[derive(Debug)]
pub struct HSS {
pub store: HashMap<u32, Vec<Element>>,
}
fn main() {
// https://github.com/rust-lang/rust/issues/49733
// https://doc.rust-lang.org/1.7.0/book/box-syntax-and-patterns.html
#![feature(box_syntax)]
#[derive(Debug)]
struct Bix(u8);
impl Bix {
pub fn new(x: u8) -> Self {
Bix(*box x) // for demo only, box serves no practical purpose here
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; to show visual artifact when using darkburn, dimmer, and perspective packages
;;
;; run with:
;; # copy the my-init.el gist somewhere, e.g. ~/Downloads
;; mkdir ./target # or rm -rf ./target/*
;; cp my-init.el ./target
;; cd ./target
;; /usr/local/bin/emacs -q -l init.el --batch # ignore the ivy-switch-buffer warning
@wrightmikea
wrightmikea / demo-transient.el
Created March 15, 2021 01:37
Elisp related to 2021 March 5th Emacs-SF online Demo of (magit) transient by Mike Wright
;; Elisp related to 2021 March 5th Emacs-SF online Demo of (magit) transient by Mike Wright
;; from: https://github.com/magit/transient/blob/master/docs/transient.org
;; under section "Hydra"
;; A Hydra “body” is equivalent to a Transient “prefix” and a Hydra “head” is equivalent to a Transient “suffix”.
;; Hydra has no equivalent of a Transient “infix”.
(transient-define-prefix outline-navigate ()
:transient-suffix 'transient--do-stay
:transient-non-suffix 'transient--do-warn
[("p" "previous visible heading" outline-previous-visible-heading)
@wrightmikea
wrightmikea / demo-nested-hydra-menus.el
Last active March 23, 2021 16:19
Elisp related to 2021 March 5 Emacs-SF Demo of Nested Hydra Menus by Mike Wright
;;; demo-nested-hydra-menus.el --- Emacs SF hydra gist -*- lexical-binding: t; -*-
;; Elisp related to 2021 March 5 Emacs-SF Demo of Nested Hydra Menus by Mike Wright
;;
;; (use-package hydra :ensure t)
;;
(progn
(require 'hydra)
(defvar hydra-stack nil)
(defun hydra-push (expr)
@wrightmikea
wrightmikea / demo-dmenu.el
Created March 15, 2021 01:47
emacs lisp functions that use dmenu; demonstrated at the Emacs SF 20210305T1000 online meetup by Mike Wright
;; emacs lisp functions that use dmenu; demonstrated at the Emacs SF 20210305T1000 online meetup by Mike Wright
;; some of these are copied or derived from a file I found via a github search for dmenu in .el files:
;; https://github.com/maavelar5/dotemacs/blob/2dd1d7e7af035edbfccfcdbbcbefdd55ba19ce44/.emacs.d/functions.el
;; to honor the license in Marco Avelar's functions.el, this file is also licensed under zlib.
;; https://en.wikipedia.org/wiki/Zlib_License
;; FYI, Marco (@marco) has a nice video demo: https://lbry.tv/@marco:55/emacs_dmenu_replacing_ivy:6
;; "Emacs + dmenu is awesome! bye bye Ivy!" October 31st, 2020
@wrightmikea
wrightmikea / demo-tmm.el
Created March 15, 2021 02:17
Elisp related to text-mode menu part of 2021 March 5 Emacs SF Dmenu Demo by Mike Wright
;; Elisp related to text-mode menu part of 2021 March 5 Emacs SF Dmenu Demo by Mike Wright
(progn
;; Creating a new menu pane in the menu bar to the right of “Tools” menu
(define-key-after
global-map
[menu-bar mymenu]
(cons "MyMenu" (make-sparse-keymap "mymenu mymenu"))
'tools )
@wrightmikea
wrightmikea / demo-transient2.el
Last active March 15, 2021 03:54
Emacs-SF - Additional Elisp related to 2021 March 5th Demo of (magit) transient by Mike Wright
;; Emacs-SF - Additional Elisp related to 2021 March 5th Demo of (magit) transient by Mike Wright
;; in the following two examples, the call to invoke grep is replaced with a message displaying arguments instead.
;; 1 of 2 - the long way (18 non-blank lines of code)
(progn
(defun my-grep-function (&optional args)
(interactive
(list (transient-args 'my-grep-transient)))