Skip to content

Instantly share code, notes, and snippets.

View mullikine's full-sized avatar
🍓

Shane Mulligan mullikine

🍓
  • Dunedin, NZ
View GitHub Profile
@mullikine
mullikine / presentation.org
Created November 7, 2020 00:24 — 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
@mullikine
mullikine / curry-compose.el
Created August 16, 2020 00:58 — forked from eschulte/curry-compose.el
Implementation of curry, rcurry and compose in Emacs Lisp. Including some code to make Emacs display these functions in a compact and attractive manner.
;;; Commentary
;;
;; Allows for more compact anonymous functions. The following
;; examples demonstrate the usage.
;;
;; ;; partial application with `curry'
;; (mapcar (» #'+ 2) '(1 2 3 4)) ; => (3 4 5 6)
;;
;; ;; alternate order of arguments with `rcurry'
;; (mapcar (« #'- 1) '(1 2 3 4)) ; => (0 1 2 3)
@mullikine
mullikine / ununzip.sh
Created May 25, 2020 04:02 — forked from mieky/ununzip.sh
Un-unzip a file without a root folder that spews its contents all around the place.
#!/bin/bash
# A bash-wrapped version of http://www.commandlinefu.com/commands/view/9536/un-unzip-a-file
if [ $# -eq 0 ]; then
echo "Un-unzips a file without a root folder."
echo "Usage: ununzip <filename>"
exit 1
elif [ ! -e $1 ]; then
echo "File not found: $1"
exit 1
fi
@mullikine
mullikine / txt
Created February 14, 2020 02:56 — forked from wattry/txt
Docker Cheatsheet
# Images
docker build -t friendlyname . # Create image using this directory's Dockerfile
docker image ls -a # List all images on this machine
docker image rm <image id> # Remove specified image from this machine
docker image rm $(docker image ls -a -q) # Remove all images from this machine
docker image prune # remove dangling images
docker tag <image> username/repository:tag # Tag <image> for upload to registry
docker push username/repository:tag # Upload tagged image to registry
docker run username/repository:tag # Run image from a registry
@mullikine
mullikine / docker-help.md
Created January 26, 2020 01:52 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@mullikine
mullikine / latency.txt
Created December 14, 2019 01:43 — forked from bafna/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@mullikine
mullikine / predictive-models.ipynb
Created December 4, 2019 08:56 — forked from aparrish/predictive-models.ipynb
Predictive text and text generation notebook. Written for Code Societies at SFPC, summer 2018. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mullikine
mullikine / from-plain-text.ipynb
Created December 4, 2019 08:12 — forked from aparrish/from-plain-text.ipynb
Semantic similarity chatbots from plain-text files ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mullikine
mullikine / bonus 1 solution
Created December 3, 2019 02:29 — forked from erantapaa/bonus 1 solution
Daily Programmer 2017-09-22 Solution
iniital board:
1 3 2 5 4 2 2 3
1 12345678 .....6.. 12345678 12345678 ....5... 12345678 1....... 12345678 3
4 12345678 .2...... 1....... 12345678 12345678 12345678 12345678 12345678 2
3 .2...... 12345678 12345678 12345678 .....6.. 12345678 ..3..... 12345678 5
3 12345678 12345678 12345678 12345678 12345678 .......8 12345678 12345678 2
2 12345678 12345678 .....6.. 12345678 12345678 ..3..... ......7. 12345678 3
2 12345678 12345678 ....5... 12345678 12345678 12345678 12345678 12345678 1
4 12345678 12345678 12345678 12345678 12345678 12345678 12345678 ..3..... 3
3 12345678 12345678 12345678 12345678 ..3..... 12345678 12345678 12345678 3

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]: