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 / 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 / spacy-extraction-medley.py
Created December 4, 2019 08:06
Example code for extracting things with spacy and writing them out to text files and then reading them in again. https://gist.github.com/aparrish/18b9290fefdb4511f6909c2fd9dee12f
# coding: utf-8
# # Extracting and writing to files
import spacy
def flatten_subtree(st):
return ''.join([w.text_with_ws for w in list(st)]).strip()
@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
@mullikine
mullikine / all-prs.txt
Created October 17, 2019 03:07
All PRs
https://github.com/0xAX/go-algorithms/pull/18
https://github.com/360EntSecGroup-Skylar/excelize/pull/303
https://github.com/360EntSecGroup-Skylar/excelize/pull/315
https://github.com/3d0c/gmf/pull/98
https://github.com/AdguardTeam/AdGuardHome/pull/638
https://github.com/AlecAivazis/survey/pull/181
https://github.com/AlessandroMinoccheri/codeigniter-currency-converter/pull/16
https://github.com/AntoineAugusti/feature-flags/pull/10
https://github.com/AntoineAugusti/feature-flags/pull/11
https://github.com/AntoineAugusti/moduluschecking/pull/15
@mullikine
mullikine / my-spacemacs.el
Created October 16, 2019 13:06
eshell-unique
(defun eshell-unique (&optional arg)
(interactive "P")
(progn
(eshell arg)
;; (rename-buffer "*eshell*" t ;; (concat "*eshell-" (substring (uuidgen-4) 0 8) "*")
;; )
(rename-buffer (concat "*eshell-" (substring (uuidgen-4) 0 8) "*")
)))
@mullikine
mullikine / scratchFlZM75.txt
Created October 15, 2019 23:19
ead cl-platform
./cl-start-pf-monitoring:7:tm-restart-command -c -E "cl-platform $platform_target; cl-reset-hosts; sudo kubefwd services -n monitoring"
./start-dev-platform:30:# cl-platform dev-paas
./start-dev-platform:31:# cl-platform dev-staging
./start-dev-platform:41:cl-platform "$platform"
./cl-rm-cert:4:platform="$(cl-platform)"
./clq:10: cl-platform
./clq:98: platform="$(cl-platform)"
./clq:117: platform="$(cl-platform)"
./cl-query:10: cl-platform
./cl-query:98: platform="$(cl-platform)"

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]:
@mullikine
mullikine / format.hs
Created May 5, 2019 06:37 — forked from Mozk0/format.hs
統合TVのネタバレスーパーを生成する。
import System.Environment (getArgs)
import Control.Monad (mapM_)
import Data.Functor ((<$>))
import Data.String.Utils (replace) -- missingH
import System.IO.UTF8 (putStrLn, readFile) -- utf8-string
import Prelude hiding (putStrLn, readFile)
main :: IO ()
main = main' =<< getArgs
@mullikine
mullikine / rbtree.lisp
Created May 5, 2019 06:33 — forked from Mozk0/rbtree.lisp
Red Black Tree for Common Lisp.
;; The following implementation of rb-tree is based on http://www.cs.kent.ac.uk/people/staff/smk/redblack/.
(defun change-to-black (tree)
(pattern-match tree
((:pattern (_ . rest) :variable rest :ignore _) `(:B . ,rest))
(:otherwise nil)))
(defun rb-insert (tree obj cmp)
(change-to-black (rb-insert% tree obj cmp)))
@mullikine
mullikine / binary_tree_1.scm
Created April 27, 2019 01:36 — forked from zallarak/binary_tree_1.scm
Binary trees in Scheme
; sets as unordered lists:
; a set for now is defined as as being able
; to undergo the following operations
; 1) element-of-set? checks if x is in set
(define (element-of-set? x set)
(cond ((null? set) false)
((equal? x (car set)) true)
(else (element-of-set? x (cdr set)))))