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
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
# Download a range of URLs in parallel.
# https://gist.github.com/kylemcdonald/3cbd09752e340849e4b3cb4f12dd8c85
from multiprocessing.dummy import Pool
from tqdm import tqdm
from urllib.parse import urlsplit
import urllib3
@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.
# coding: utf-8
# # Predictive text with concatenated word vectors
#
# By [Allison Parrish](http://www.decontextualize.com/)
#
# This notebook demonstrates one way to implement predictive text like [iOS QuickType](https://www.apple.com/sg/ios/whats-new/quicktype/). It works sort of like a [Markov chain text generator](https://github.com/aparrish/rwet/blob/master/ngrams-and-markov-chains.ipynb), but uses nearest-neighbor lookups on a database of concatenated [word vectors](https://github.com/aparrish/rwet/blob/master/understanding-word-vectors.ipynb) instead of n-grams of tokens. You can build this database with any text you want!
#
# To get this code to work, you'll need to [install spaCy](https://spacy.io/usage/#section-quickstart), download a [spaCy model with word vectors](https://spacy.io/usage/models#available) (like `en_core_web_lg`). You'll also need [Simple Neighbors](https://github.com/aparrish/simpleneighbors), a Python library I made for easy nearest neighbor lookups:
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
# coding: utf-8
# # Semantic similarity chatbots from plain-text files
#
# By [Allison Parrish](http://www.decontextualize.com/)
#
# This needs copy, sorry :( :( :( But it works!